Ignore:
Timestamp:
Aug 12, 2009, 7:14:16 PM (15 years ago)
Author:
Kevin Toppenberg
Message:

TMG Ver 1.1 Added HTML Support, better demographics editing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/tmg-cprs/CPRS-Chart/fNotePrt.pas

    r453 r541  
    1 //kt -- Modified with SourceScanner on 8/25/2007
     1//kt -- Modified with SourceScanner on 8/25/2007, also 8/09
    22unit fNotePrt;
    33
     
    5454{$R *.DFM}
    5555
    56 uses rCore, rTIU, rReports, uCore, Printers;
     56uses rCore, rTIU, rReports, uCore, Printers,
     57     rHTMLTools; //kt 8/09
     58
    5759
    5860const
     
    206208  RemoteSiteID: string;    //for Remote site printing
    207209  RemoteQuery: string;    //for Remote site printing
     210  TempLines: TStringList;  //kt added 5-31-05
    208211begin
    209212  SetupVars;  //kt added 8/25/2007 to replace constants with vars.
     
    223226
    224227
    225   if Piece(cboDevice.ItemID, ';', 1) = 'WIN' then
    226     begin
    227     if dlgWinPrinter.Execute then
    228        begin
    229        FReportText.Lines.Assign(GetFormattedNote(FNote, ChartCopy));
    230        PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg);
    231        if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
    232        end
    233     end
    234   else
    235     begin
     228  if Piece(cboDevice.ItemID, ';', 1) = 'WIN' then begin
     229    if dlgWinPrinter.Execute then begin
     230      //kt ----- Begin original code -------------  8/09
     231      //kt FReportText.Lines.Assign(GetFormattedNote(FNote, ChartCopy));
     232      //kt PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg);
     233      //kt if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
     234      //kt ----- End original code -------------
     235      TempLines := TStringList.Create;                                          //kt 8/09
     236      TempLines.Assign(GetFormattedNote(FNote, ChartCopy));                     //kt 8/09
     237      if not rHTMLTools.IsHTML(TempLines) then begin                            //kt 8/09
     238        //NOTE: If HTML, then bypass this printer dialog, because it will be    //kt 8/09
     239        //      replaced by a printer dialog that internet explorer uses.       //kt 8/09
     240        if dlgWinPrinter.Execute then begin                                     //kt 8/09
     241          FReportText.Lines.Assign(TempLines);                                  //kt 8/09
     242          PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg,Application); //kt 8/09
     243        end;                                                                    //kt 8/09
     244      end else begin                                                            //kt 8/09
     245        LoadDocumentText(TempLines, FNote);  //Get document without headers/footers      //kt 8/09
     246        PrintHTMLReport(TempLines, ErrMsg, Patient.Name,                        //kt 8/09
     247                        FormatFMDateTime('mm/dd/yyyy', Patient.DOB),            //kt 8/09
     248                        Patient.WardService, Application);                      //kt 8/09
     249      end;                                                                      //kt 8/09
     250      TempLines.Free;                                                           //kt 8/09
     251      if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);            //kt 8/09
     252    end;                                                                        //kt 8/09
     253  end else begin
    236254    ADevice := Piece(cboDevice.ItemID, ';', 2);
    237255    PrintNoteToDevice(FNote, ADevice, ChartCopy, ErrMsg);
     
    243261  if chkDefault.Checked then
    244262     SaveDefaultPrinter(Piece(cboDevice.ItemID, ';', 1));
    245      
     263
    246264  User.CurrentPrinter := cboDevice.ItemID;
    247265  Close;
Note: See TracChangeset for help on using the changeset viewer.