Procedure

PrintNote

Module

fNotePrt

Last Modified

7/15/2014 3:26:38 PM

Comments

Displays a form that prompts for a device and then prints the progress note

Scope

Interfaced

Declaration

procedure PrintNote(ANote: Longint; const ANoteTitle: string; MultiNotes: boolean = False);

Calls Hierarchy


PrintNote
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 ├AllowChartPrintForNote
 ├GetDefaultPrinter
 ├TUser.SetCurrentPrinter
 └TfrmNotePrint.cmdOKClick
   ├CreateReportTextComponent
   │ └ReportTextFontChange
   ├GetFormattedNote
   ├PrintWindowsReport
   │ └CreatePatientHeader
   │   ├TEncounter.GetLocationName
   │   │ └TEncounter.UpdateText
   │   │   └GetEncounterText
   │   └FMNow
   ├PrintNoteToDevice
   ├SaveDefaultPrinter
   └TUser.SetCurrentPrinter

Called-By Hierarchy


                             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
AllowChartPrintForNote function AllowChartPrintForNote(ANote: Integer): Boolean; -
TfrmNotePrint.cmdOKClick procedure cmdOKClick(Sender: TObject); -
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
GetDefaultPrinter function GetDefaultPrinter(DUZ: Int64; Location: integer): string; -
TUser.SetCurrentPrinter procedure SetCurrentPrinter(Value: string); -

Called-By

Name Declaration Comments
TfrmConsults.mnuActNotePrintClick procedure mnuActNotePrintClick(Sender: TObject); -
TfrmDCSumm.RequestMultiplePrint procedure RequestMultiplePrint(AForm: TfrmPrintList); -
TfrmNotes.RequestMultiplePrint procedure RequestMultiplePrint(AForm: TfrmPrintList); -
TfrmDCSumm.RequestPrint procedure RequestPrint; override; -
TfrmSurgery.RequestPrint procedure RequestPrint; override; -
TfrmNotes.RequestPrint procedure RequestPrint; override; -


Source

57    procedure PrintNote(ANote: Longint; const ANoteTitle: string; MultiNotes: boolean = False);
58    { displays a form that prompts for a device and then prints the progress note }
59    var
60      frmNotePrint: TfrmNotePrint;
61      DefPrt: string;
62    begin
63      frmNotePrint := TfrmNotePrint.Create(Application);
64      try
65        ResizeFormToFont(TForm(frmNotePrint));
66        with frmNotePrint do
67        begin
68          { check to see of Chart Print allowed outside of MAS }
69          if AllowChartPrintForNote(ANote) then
70            begin
71              {This next code begs the question: Why are we even bothering to check
72              radWorkCopy if we immediately check the other button?
73              Short answer: it seems to wokr better
74              Long answer: The checkboxes have to in some way register with the group
75              they are in.  If this doesn't happen, both will be initially included
76              the tab order.  This means that the first time tabbing through the
77              controls, the work copy button would be tabbed to and selected after the
78              chart copy.  Tabbing through controls should not change the group
79              selection.
80              }
81              radWorkCopy.Checked := True;
82              radChartCopy.Checked := True;
83            end
84          else
85            begin
86              radChartCopy.Enabled := False;
87              radWorkCopy.Checked := True;
88            end;
89    
90          lblNoteTitle.Text := ANoteTitle;
91          frmNotePrint.Caption := 'Print ' + Piece(Piece(ANoteTitle, #9, 2), ',', 1);
92          FNote := ANote;
93          DefPrt := GetDefaultPrinter(User.Duz, Encounter.Location);
94    
95          if User.CurrentPrinter = '' then User.CurrentPrinter := DefPrt;
96    
97          with cboDevice do
98            begin
99              if Printer.Printers.Count > 0 then
100               begin
101                 Items.Add('WIN;Windows Printer^Windows Printer');
102                 Items.Add('^--------------------VistA Printers----------------------');
103               end;
104             if User.CurrentPrinter <> '' then
105               begin
106                 InitLongList(Piece(User.CurrentPrinter, ';', 2));
107                 SelectByID(User.CurrentPrinter);
108               end
109             else
110               InitLongList('');
111           end;
112   
113         if ((DefPrt = 'WIN;Windows Printer') and (User.CurrentPrinter = DefPrt)) then
114           cmdOKClick(frmNotePrint) //CQ6660
115           //Commented out for CQ6660
116            //or
117            //((User.CurrentPrinter <> '') and
118             //(MultiNotes = True)) then
119              //frmNotePrint.cmdOKClick(frmNotePrint)
120           //end CQ6660
121         else
122           frmNotePrint.ShowModal;
123       end;
124     finally
125       frmNotePrint.Release;
126     end;
127   end;