Procedure

TfrmODLab.DisplayChangedOrders

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODLab

Declaration

procedure DisplayChangedOrders(ACollType: string);

Calls Hierarchy


TfrmODLab.DisplayChangedOrders
 ├TResponses.FindResponseByName
 ├CheckForChangeFromLCtoWCOnAccept
 │ └FormatLCtoWCDisplayTextOnAccept
 │   └GetLCtoWCInstructions
 ├TResponses.GetOrderText
 │ ├TResponses.NextInstance
 │ ├TResponses.FindResponseByName
 │ ├TResponses.FormatResponse
 │ │ └TResponses.FindResponseByIEN
 │ └TResponses.AppendChildren
 │   ├TResponses.FindPromptByIEN
 │   ├TResponses.FindResponseByIEN
 │   └TResponses.FormatResponse...
 └ReportBox
   └CreateReportBox
     └TfrmBase508Form.Create
       ├TfrmBase508Form.UpdateAccessibilityActions
       ├UnfocusableControlEnter
       └AdjustControls
         ├TfrmBase508Form.ModifyUnfocusableControl
         └..(rec)..

Called-By Hierarchy


TfrmODLab.DisplayChangedOrders
          TfrmODLab.Validate┘ 

Calls

Name Declaration Comments
CheckForChangeFromLCtoWCOnAccept procedure CheckForChangeFromLCtoWCOnAccept(Dest: TStrings; ALocation: integer; AStartDate, ACollType, ASchedule, ADuration: string); -
TResponses.FindResponseByName function FindResponseByName(const APromptID: string; AnInstance: Integer): TResponse; -
TResponses.GetOrderText function GetOrderText: string; -
ReportBox procedure ReportBox(ReportText: TStrings; ReportTitle: string; AllowPrint: boolean); -

Called-By

Name Declaration Comments
TfrmODLab.Validate procedure Validate(var AnErrMsg: string); override; -


Source

1181  procedure TfrmODLab.DisplayChangedOrders(ACollType: string);
1182  var
1183    AStartDate, ASchedule, ADuration: string;
1184    ChangedOrdersList, AList: TStringlist;
1185    i, j, k: integer;
1186  begin
1187    ChangedOrdersList := TStringList.Create;
1188    try
1189      AStartDate := Responses.FindResponseByName('START', 1).IValue;
1190      ASchedule  := Responses.FindResponseByName('SCHEDULE', 1).IValue;
1191      if txtDays.Enabled then ADuration := Responses.FindResponseByName('DAYS', 1).EValue else ADuration := '';
1192      CheckForChangeFromLCtoWCOnAccept(ChangedOrdersList, Encounter.Location, AStartDate, ACollType, ASchedule, ADuration);
1193      if ChangedOrdersList.Text <> '' then
1194      begin
1195        AList := TStringList.Create;
1196        try
1197          AList.Text := Responses.OrderText;
1198          with ChangedOrdersList do
1199          begin
1200            Insert(5, 'Order   :' + #9 + AList[0]);
1201            k := Length(ChangedOrdersList[5]);
1202            i := 0;
1203            if AList.Count > 1 then
1204              for j := 1 to AList.Count - 1 do
1205              begin
1206                Insert(5 + j, StringOfChar(' ', 9) + #9 + AList[j]);
1207                k := HigherOf(k, Length(ChangedOrdersList[5 + j]));
1208                i := j;
1209              end;
1210            Insert(5 + i + 1, StringOfChar('-', k + 4));
1211          end;
1212          ReportBox(ChangedOrdersList, 'Changed Orders', TRUE);
1213        finally
1214          AList.Free;
1215        end;
1216      end;
1217    finally
1218      ChangedOrdersList.Free;
1219    end;
1220  end;