Procedure

TfrmOrders.RequestPrint

Directives

Override

Module

fOrders

Last Modified

7/15/2014 3:26:42 PM

Comments

Obtain print devices for selected orders, do appropriate prints

Visibility

Public

Overrides

TfrmPage.RequestPrint

Owner

TfrmOrders

Declaration

procedure RequestPrint; override;

Calls Hierarchy


TfrmOrders.RequestPrint
 ├TfrmOrders.NoneSelected
 ├CurrentLocationForPatient
 ├TEncounter.SetLocation
 ├CommonLocationForOrders
 ├LookupLocation
 │ └TfrmBase508Form.Create
 │   ├TfrmBase508Form.UpdateAccessibilityActions
 │   ├UnfocusableControlEnter
 │   └AdjustControls
 │     ├TfrmBase508Form.ModifyUnfocusableControl
 │     └..(rec)..
 ├TfrmFrame.DisplayEncounterText
 │ ├TEncounter.GetLocationText
 │ │ └TEncounter.UpdateText
 │ │   └GetEncounterText
 │ ├TEncounter.GetProviderName
 │ │ └TEncounter.UpdateText...
 │ └TfrmFrame.FitToolbar
 ├SetupOrdersPrint
 │ ├TfrmBase508Form.Create...
 │ ├OrderPrintDeviceInfo
 │ └TfrmOrdersPrint.SetupControls
 │   └TfrmOrdersPrint.SetupPrompting
 ├ExecutePrintOrders
 └TfrmOrders.SynchListToOrders
   └TfrmOrders.GetPlainText
     └TfrmOrders.GetOrderText
       ├LoadFlagReason
       ├TfrmOrders.GetStartStopText
       └NameOfStatus

Called-By Hierarchy


      TfrmOrders.RequestPrint
TfrmFrame.mnuFilePrintClick┘ 

Calls

Name Declaration Comments
CommonLocationForOrders function CommonLocationForOrders(OrderList: TStringList): Integer; -
CurrentLocationForPatient procedure CurrentLocationForPatient(const DFN: string; var ALocation: Integer; var AName: string; var ASvc: string); -
TfrmFrame.DisplayEncounterText procedure DisplayEncounterText; -
ExecutePrintOrders procedure ExecutePrintOrders(SelectedList: TStringList; const DeviceInfo: string); -
LookupLocation procedure LookupLocation(var IEN: Integer; var AName: string; const AType: integer; const HelpInfo: string); -
TfrmOrders.NoneSelected function NoneSelected(const ErrMsg: string): Boolean; -
TEncounter.SetLocation procedure SetLocation(Value: Integer); -
SetupOrdersPrint procedure SetupOrdersPrint(OrderList: TStringList; var DeviceInfo: string; Nature: Char; SelectAll: Boolean; var PrintIt: Boolean; PrintTitle: string = ''; PrintLoc: Integer = 0); -
TfrmOrders.SynchListToOrders procedure SynchListToOrders; -

Called-By

Name Declaration Comments
TfrmFrame.mnuFilePrintClick procedure mnuFilePrintClick(Sender: TObject); -


Source

2611  procedure TfrmOrders.RequestPrint;
2612  { obtain print devices for selected orders, do appropriate prints }
2613  const
2614    TX_NEW_LOC1   = 'The patient''s location has changed to ';
2615    TX_NEW_LOC2   = '.' + CRLF + 'Should the orders be printed using the new location?';
2616    TC_NEW_LOC    = 'New Patient Location';
2617  var
2618    SelectedList: TStringList;
2619    ALocation, i: Integer;
2620    AName, ASvc, DeviceInfo: string;
2621    Nature: char;
2622    PrintIt: Boolean;
2623  begin
2624    inherited;
2625    if NoneSelected(TX_NOSEL) then Exit;
2626    //if not AuthorizedUser then Exit;   removed in v17.1 (RV) SUX-0901-41044
2627    SelectedList := TStringList.Create;
2628    Nature := #0;
2629    try
2630      with lstOrders do for i := 0 to Items.Count - 1 do
2631        if Selected[i] then SelectedList.Add(Piece(TOrder(Items.Objects[i]).ID, U, 1));
2632      CurrentLocationForPatient(Patient.DFN, ALocation, AName, ASvc);
2633      if (ALocation > 0) and (ALocation <> Encounter.Location) then
2634      begin
2635      //gary
2636        Encounter.Location := frmClinicWardMeds.ClinicOrWardLocation(Alocation);
2637     //   if InfoBox(TX_NEW_LOC1 + AName + TX_NEW_LOC2, TC_NEW_LOC, MB_YESNO) = IDYES
2638     //     then Encounter.Location := ALocation;
2639      end;
2640      if Encounter.Location = 0
2641        then Encounter.Location := CommonLocationForOrders(SelectedList);
2642      if Encounter.Location = 0 then                      // location required for DEVINFO
2643      begin
2644        LookupLocation(ALocation, AName, LOC_ALL, TX_LOC_PRINT);
2645        if ALocation > 0 then Encounter.Location := ALocation;
2646      end;
2647      frmFrame.DisplayEncounterText;
2648      if Encounter.Location <> 0 then
2649        begin
2650          SetupOrdersPrint(SelectedList, DeviceInfo, Nature, False, PrintIt);
2651          if PrintIt then ExecutePrintOrders(SelectedList, DeviceInfo);
2652          SynchListToOrders;
2653        end
2654      else InfoBox(TX_PRINT_LOC, TC_REQ_LOC, MB_OK or MB_ICONWARNING);
2655    finally
2656      SelectedList.Free;
2657    end;
2658  end;