Procedure

TfrmBALocalDiagnoses.AssocDxToOrders

Module

fBALocalDiagnoses

Last Modified

7/15/2014 3:26:34 PM

Visibility

Private

Owner

TfrmBALocalDiagnoses

Declaration

procedure AssocDxToOrders;

Calls Hierarchy


TfrmBALocalDiagnoses.AssocDxToOrders
 ├IsOrderBillable
 │ └PrepOrderID
 ├TfrmBALocalDiagnoses.LoadTempRec
 │ ├TfrmFrame.GetTimedOut
 │ │ └TimedOut
 │ ├InitializeNewDxRec
 │ └StripTFactors
 ├tempDxNodeExists
 ├SetBADxListForOrder
 │ └PutBADxListForOrder
 ├TfrmBALocalDiagnoses.DeselectGridItems
 └GetUnsignedOrderFlags

Called-By Hierarchy


TfrmBALocalDiagnoses.AssocDxToOrders
    TfrmBALocalDiagnoses.buOKClick┘ 

Calls

Name Declaration Comments
TfrmBALocalDiagnoses.DeselectGridItems procedure DeselectGridItems; -
GetUnsignedOrderFlags function GetUnsignedOrderFlags(pOrderID: string; pFlagList: TStringList):string; -
IsOrderBillable function IsOrderBillable(pOrderID: string):boolean; -
TfrmBALocalDiagnoses.LoadTempRec procedure LoadTempRec(var thisRec: TBADxRecord; thisOrderID: string); -
SetBADxListForOrder procedure SetBADxListForOrder(thisRec: TBADxRecord; thisOrderID: string); -
tempDxNodeExists function tempDxNodeExists(thisOrderID: string) : boolean; -

Called-By

Name Declaration Comments
TfrmBALocalDiagnoses.buOKClick procedure buOKClick(Sender: TObject); -


Source

245   procedure TfrmBALocalDiagnoses.AssocDxToOrders;
246   var
247     tmpFlagList: TStringList;
248     i: integer;
249     thisOrderID: string;
250     tempDxRec: TBADxRecord;
251     {$ifdef debug}thismsg: string;{$endif}
252   begin
253      //** Initialize
254     if Assigned(UBAGlobals.OrderIDList) then
255        UBAGlobals.OrderIDList.Clear;
256     tmpFlagList := TStringList.Create;
257   
258     //** Associate Dx's to Orders
259     if whoCalled = F_ORDERS_SIGN then
260     begin
261     for i := 0 to fOrdersSign.frmSignOrders.clstOrders.Items.Count-1 do
262     begin
263         if (frmSignOrders.clstOrders.Selected[i]) then
264         begin
265            thisOrderID := TOrder(fOrdersSign.frmSignOrders.clstOrders.Items.Objects[i]).ID;
266            if Not UBACore.IsOrderBillable(thisOrderID) then Continue; //BAPHII 1.4.16
267               LoadTempRec(tempDxRec, thisOrderID);
268            if ((UBAGlobals.tempDxList <> nil) and (not UBAGlobals.tempDxNodeExists(thisOrderID))) then
269               UBAGlobals.tempDxList.Add(TBADxRecord(tempDxRec))
270            else
271            begin
272             //** Order already exists in Dx list, so modifiy existing Dx record
273               SetBADxListForOrder(tempDxRec, thisOrderID);
274            end;
275               //** Add it to OrderID string list
276            if Assigned(UBAGlobals.OrderIDList) then
277               UBAGlobals.OrderIDList.Add(thisOrderID);
278         end; //** if
279      end; //** for
280      end
281      else
282         if whoCalled = F_REVIEW then
283            begin
284            DeselectGridItems;
285            for i := 0 to fReview.frmReview.lstReview.Items.Count-1 do
286            begin
287               if (frmReview.lstReview.Selected[i]) then
288               begin
289                  thisOrderID := TOrder(fReview.frmReview.lstReview.Items.Objects[i]).ID;
290                  if Not UBACore.IsOrderBillable(thisOrderID) then Continue; //BAPHII 1.4.16
291                  LoadTempRec(tempDxRec, thisOrderID);
292                  if ((UBAGlobals.tempDxList <> nil) and (not UBAGlobals.tempDxNodeExists(thisOrderID))) then
293                     UBAGlobals.tempDxList.Add(TBADxRecord(tempDxRec))
294                  else
295                  begin
296                         //** Order already exists in Dx list, so modifiy existing Dx record
297                     SetBADxListForOrder(tempDxRec, thisOrderID);
298                     GetUnsignedOrderFlags(thisOrderID,tmpFlagList);
299                 end;
300   
301                       //** Add it to OrderID string list
302                  if Assigned(UBAGlobals.OrderIDList) then
303                     UBAGlobals.OrderIDList.Add(thisOrderID);
304               end;
305            end; //for
306      end;
307   end;