Procedure

TfrmNotePrint.cmdOKClick

Module

fNotePrt

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmNotePrint

Declaration

procedure cmdOKClick(Sender: TObject);

Calls Hierarchy


TfrmNotePrint.cmdOKClick
 ├CreateReportTextComponent
 │ └ReportTextFontChange
 ├GetFormattedNote
 ├PrintWindowsReport
 │ └CreatePatientHeader
 │   ├TEncounter.GetLocationName
 │   │ └TEncounter.UpdateText
 │   │   └GetEncounterText
 │   └FMNow
 ├PrintNoteToDevice
 ├SaveDefaultPrinter
 └TUser.SetCurrentPrinter

Called-By Hierarchy


                TfrmNotePrint.cmdOKClick
                             PrintNote┘ 
             TfrmDCSumm.RequestPrint┤   
       TfrmFrame.mnuFilePrintClick┘ │   
     TfrmDCSumm.RequestMultiplePrint┤   
          TfrmPrintList.cmdOKClick┘ │   
   TfrmConsults.mnuActNotePrintClick┤   
TfrmConsults.popNoteMemoPrintClick┘ │   
            TfrmSurgery.RequestPrint┤   
       TfrmFrame.mnuFilePrintClick┘ │   
              TfrmNotes.RequestPrint┤   
       TfrmFrame.mnuFilePrintClick┘ │   
      TfrmNotes.RequestMultiplePrint┘   
          TfrmPrintList.cmdOKClick┘     

Calls

Name Declaration Comments
CreateReportTextComponent function CreateReportTextComponent(ParentForm: TForm): TRichEdit; -
GetFormattedNote function GetFormattedNote(ANote: Integer; ChartCopy: Boolean): TStrings; -
PrintNoteToDevice procedure PrintNoteToDevice(ANote: Integer; const ADevice: string; ChartCopy: Boolean; var ErrMsg: string); -
PrintWindowsReport procedure PrintWindowsReport(ARichEdit: TRichEdit; APageBreak, ATitle: string; var ErrMsg: string; IncludeHeader: Boolean = false); -
SaveDefaultPrinter procedure SaveDefaultPrinter(DefPrinter: string) ; -
TUser.SetCurrentPrinter procedure SetCurrentPrinter(Value: string); -

Called-By

Name Declaration Comments
PrintNote procedure PrintNote(ANote: Longint; const ANoteTitle: string; MultiNotes: boolean = False); -


Source

168   procedure TfrmNotePrint.cmdOKClick(Sender: TObject);
169   var
170     ADevice, ErrMsg: string;
171     ChartCopy: Boolean;
172     RemoteSiteID: string;    //for Remote site printing
173     RemoteQuery: string;    //for Remote site printing
174   begin
175     inherited;
176     RemoteSiteID := '';
177     RemoteQuery := '';
178   
179     if cboDevice.ItemID = '' then
180        begin
181        InfoBox(TX_NODEVICE, TX_NODEVICE_CAP, MB_OK);
182        Exit;
183        end;
184   
185     if radChartCopy.Checked then
186        ChartCopy := True
187     else ChartCopy := False;
188   
189   
190     if Piece(cboDevice.ItemID, ';', 1) = 'WIN' then
191       begin
192       if dlgWinPrinter.Execute then
193          begin
194          FReportText := CreateReportTextComponent(Self);
195          FastAssign(GetFormattedNote(FNote, ChartCopy), FReportText.Lines);
196          PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg);
197          if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
198          end
199       end
200     else
201       begin
202       ADevice := Piece(cboDevice.ItemID, ';', 2);
203       PrintNoteToDevice(FNote, ADevice, ChartCopy, ErrMsg);
204   
205       if Length(ErrMsg) > 0 then
206           InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
207       end;
208   
209     if chkDefault.Checked then
210        SaveDefaultPrinter(Piece(cboDevice.ItemID, ';', 1));
211   
212     User.CurrentPrinter := cboDevice.ItemID;
213     Close;
214   end;