Procedure

CompleteConsultOrderRec

Module

UBACore

Last Modified

7/15/2014 3:26:34 PM

Scope

Interfaced

Declaration

procedure CompleteConsultOrderRec(pOrderID: string; pDxList: TStringList);

Calls Hierarchy


CompleteConsultOrderRec
 ├InitializeConsultOrderRec
 ├rpcNonBillableOrders
 ├IsOrderBillable
 │ └PrepOrderID
 ├tempDxNodeExists
 ├LoadConsultOrderRec
 ├SimpleAddTempDxList
 │ └TfrmBALocalDiagnoses.LoadTempRec
 │   ├TfrmFrame.GetTimedOut
 │   │ └TimedOut
 │   ├InitializeNewDxRec
 │   └StripTFactors
 ├PutBADxListForOrder
 ├IsUserNurseProvider
 │ └PersonHasKey
 ├BuildConsultDxRec
 ├GetPatientTFactors
 ├ConvertPIMTreatmentFactors
 └SaveBillingData
   ├AttachDxToOrderList
   │ ├InitializeNewDxRec
   │ └GetBADxListForOrder
   └rpcSaveCIDCData
     └VerifyOrderIdExists

Called-By Hierarchy


    CompleteConsultOrderRec
TfrmODCslt.cmdAcceptClick┘ 

Calls

Name Declaration Comments
BuildConsultDxRec function BuildConsultDxRec(ConsultRec: TBAConsultOrderRec): string; -
ConvertPIMTreatmentFactors function ConvertPIMTreatmentFactors(pTFactors:string):string; -
GetPatientTFactors function GetPatientTFactors(pOrderList:TStringList): String; -
InitializeConsultOrderRec procedure InitializeConsultOrderRec(var thisDxRec: TBAConsultOrderRec); -
IsOrderBillable function IsOrderBillable(pOrderID: string):boolean; -
IsUserNurseProvider function IsUserNurseProvider(pUserID: int64): boolean; -
LoadConsultOrderRec procedure LoadConsultOrderRec(var thisRetVal: TBAConsultOrderRec; pOrderID: String; pDxList: TStringList); -
PutBADxListForOrder procedure PutBADxListForOrder(var thisRecord: TBADxRecord; thisOrderID: string); -
rpcNonBillableOrders function rpcNonBillableOrders(pOrderList: TStringList): TStringList; -
SaveBillingData procedure SaveBillingData(pBillingData:TStringList); -
SimpleAddTempDxList procedure SimpleAddTempDxList(thisOrderID: string); -
tempDxNodeExists function tempDxNodeExists(thisOrderID: string) : boolean; -

Called-By

Name Declaration Comments
TfrmODCslt.cmdAcceptClick procedure cmdAcceptClick(Sender: TObject); -


Source

1180  procedure CompleteConsultOrderRec(pOrderID: string; pDxList: TStringList);
1181  var
1182    RecOut : TBADxRecord;
1183    TfFlags,dxRec: string;
1184    orderList : TStringList;
1185    tmpOrderList: TStringList;
1186  begin
1187      orderList    := TStringList.Create;
1188      tmpOrderList := TStringList.Create;
1189      orderList.Clear;
1190      tmpOrderList.Clear;
1191      if not Assigned(UBAGlobals.ConsultOrderRec)then
1192         begin
1193            UBAGlobals.ConsultOrderRec := UBAGlobals.TBAConsultOrderRec.Create;
1194            InitializeConsultOrderRec(UBAGlobals.ConsultOrderRec);
1195         end
1196      else
1197         InitializeConsultOrderRec(UBAGlobals.ConsultOrderRec);
1198      // call rpc to load list with boolean values based on orders package type.
1199      UBAGlobals.NonBillableOrderList.Clear;
1200      tmpOrderList.Add(UBAGlobals.BAOrderID);
1201      rpcNonBillableOrders(tmpOrderList);
1202      if IsOrderBillable(UBAGlobals.BAOrderID) then
1203      begin
1204         if not UBAGlobals.tempDxNodeExists(UBAGlobals.BAOrderID) then
1205            begin
1206               LoadConsultOrderRec(UBAGlobals.ConsultOrderRec,UBAGlobals.BAOrderID,UBAGlobals.BAConsultDxList);
1207               if NOT UBAGlobals.tempDxNodeExists(pOrderID) then
1208                  SimpleAddTempDxList(pOrderID);
1209               RecOut := TBADxRecord.Create;
1210               RecOut.FExistingRecordID := pOrderID;
1211               RecOut.FBADxCode  := ConsultOrderRec.FBADxCode;
1212               RecOut.FBASecDx1  := ConsultOrderRec.FBASecDx1;
1213               RecOut.FBASecDx2  := ConsultOrderRec.FBASecDx2;
1214               RecOut.FBASecDx3  := ConsultOrderRec.FBASecDx3;
1215               RecOut.FTreatmentFactors := ConsultOrderRec.FBATreatmentFactors;
1216               PutBADxListForOrder(RecOut, RecOut.FExistingRecordID);
1217  //  HDS00003380
1218               if IsUserNurseProvider(User.DUZ) then
1219               begin
1220                  dxRec := BuildConsultDxRec(ConsultOrderRec);
1221                  orderList.Add(RecOut.FExistingRecordID);
1222                //  TfFlags := Piece(GetPatientTFactors(orderList),U,2);
1223                  TfFlags := GetPatientTFactors(orderList);
1224                  TfFlags := ConvertPIMTreatmentFactors(TfFlags);
1225                  orderList.Clear;
1226                //  if strLen(PChar(dxRec)) > 0 then
1227                //     orderList.Add(RecOut.FExistingRecordID +TfFlags + '^'+ BuildConsultDxRec(ConsultOrderRec) )
1228                //  else
1229                     orderList.Add(RecOut.FExistingRecordID +TfFlags);
1230                  SaveBillingData(OrderList);  //  save unsigned info to be displayed when re
1231               end;
1232            end;
1233        end;
1234  end;