Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders/rODBase.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/Orders/rODBase.pas
r459 r460 68 68 end; 69 69 70 TPFSSActive = record 71 PFSSActive: boolean; 72 PFSSChecked: boolean; 73 end; 74 70 75 { General Calls } 71 76 function AskAnotherOrder(ADialog: Integer): Boolean; … … 75 80 procedure LoadDialogDefinition(Dest: TList; const DialogName: string); 76 81 procedure LoadOrderPrompting(Dest: TList; ADialog: Integer); 77 procedure LoadResponses(Dest: TList; const OrderID: string); 82 //procedure LoadResponses(Dest: TList; const OrderID: string); 83 procedure LoadResponses(Dest: TList; const OrderID: string; var HasObjects: boolean); 78 84 procedure PutNewOrder(var AnOrder: TOrder; ConstructOrder: TConstructOrder; OrderSource: string); 79 85 //procedure PutNewOrderAuto(var AnOrder: TOrder; ADialog: Integer); // no longer used … … 88 94 procedure SetDefaultCoPayToNewOrder(AnOrderID, CoPayInfo:string); 89 95 procedure ValidateNumericStr(const x, Dom: string; var ErrMsg: string); 90 96 function IsPFSSActive: boolean; 91 97 92 98 { Quick Order Calls } … … 126 132 implementation 127 133 128 uses TRPCB, uOrders;134 uses TRPCB, uOrders, uODBase; 129 135 130 136 var … … 133 139 uLastQuantityMsg: string; 134 140 uMedRoutes: TStringList; 141 uPFSSActive: TPFSSActive; 135 142 136 143 { Common Internal Calls } … … 175 182 begin 176 183 IVDurVal := Copy(IVDuration,1,length(IVDuration)-1); 177 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + ' 184 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + 'hours'; 178 185 end 179 186 else if (Pos('D',upperCase(IVDuration))>0) then 180 187 begin 181 188 IVDurVal := Copy(IVDuration,1,length(IVDuration)-1); 182 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + ' 189 TResponse(ResponseList.Items[j]).IValue := 'for ' + IVDurVal + 'days'; 183 190 end 184 191 else if ((Pos('ML',upperCase(IVDuration))>0) or (Pos('CC',upperCase(IVDuration))>0)) then 185 192 begin 186 193 IVDurVal := Copy(IVDuration,1,length(IVDuration)-2); 187 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + ' 194 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + 'ml'; 188 195 end 189 196 else if (Pos('L',upperCase(IVDuration))>0) then 190 197 begin 191 198 IVDurVal := Copy(IVDuration,0,length(IVDuration)-1); 192 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + ' 199 TResponse(ResponseList.Items[j]).IValue := 'with total volume ' + IVDurVal + 'L'; 193 200 end; 194 201 end; … … 371 378 end; 372 379 373 procedure ExtractToResponses(Dest: TList );380 procedure ExtractToResponses(Dest: TList; var HasObjects: boolean); 374 381 { load a list with TResponse records, assumes source strings are in RPCBrokerV.Results } 375 382 var 376 383 i: Integer; 377 384 AResponse: TResponse; 385 WPContainsObjects, TxContainsObjects: boolean; 386 TempBroker: TStrings; 378 387 begin 379 388 i := 0; 380 with RPCBrokerV do while i < Results.Count do 381 begin 382 if CharAt(Results[i], 1) = '~' then 389 HasObjects := FALSE; 390 TempBroker := TStringlist.Create; 391 TempBroker.Assign(RPCBrokerV.Results); 392 try 393 with TempBroker do while i < Count do 394 begin 395 if CharAt(Strings[i], 1) = '~' then 383 396 begin 384 397 AResponse := TResponse.Create; 385 398 with AResponse do 386 399 begin 387 PromptIEN := StrToIntDef(Piece(Copy( Results[i], 2, 255), U, 1), 0);388 Instance := StrToIntDef(Piece( Results[i], U, 2), 0);389 PromptID := Piece( Results[i], U, 3);400 PromptIEN := StrToIntDef(Piece(Copy(Strings[i], 2, 255), U, 1), 0); 401 Instance := StrToIntDef(Piece(Strings[i], U, 2), 0); 402 PromptID := Piece(Strings[i], U, 3); 390 403 Inc(i); 391 while (i < Results.Count) and (CharAt(Results[i], 1) <> '~') do404 while (i < Count) and (CharAt(Strings[i], 1) <> '~') do 392 405 begin 393 if CharAt( Results[i], 1) = 'i' then IValue := Copy(Results[i], 2, 255);394 if CharAt( Results[i], 1) = 'e' then EValue := Copy(Results[i], 2, 255);395 if CharAt( Results[i], 1) = 't' then406 if CharAt(Strings[i], 1) = 'i' then IValue := Copy(Strings[i], 2, 255); 407 if CharAt(Strings[i], 1) = 'e' then EValue := Copy(Strings[i], 2, 255); 408 if CharAt(Strings[i], 1) = 't' then 396 409 begin 397 410 if Length(EValue) > 0 then EValue := EValue + CRLF; 398 EValue := EValue + Copy( Results[i], 2, 255);411 EValue := EValue + Copy(Strings[i], 2, 255); 399 412 IValue := TX_WPTYPE; // signals that this is a word processing field 400 413 end; 401 414 Inc(i); 402 415 end; {while i} 416 if IValue <> TX_WPTYPE then ExpandOrderObjects(IValue, TxContainsObjects); 417 ExpandOrderObjects(EValue, WPContainsObjects); 418 HasObjects := HasObjects or WPContainsObjects or TxContainsObjects; 403 419 Dest.Add(AResponse); 404 420 end; {with AResponse} 405 421 end; {if CharAt} 406 422 end; {With RPCBrokerV} 407 end; 408 409 procedure LoadResponses(Dest: TList; const OrderID: string); 423 finally 424 TempBroker.Free; 425 end; 426 end; 427 428 procedure LoadResponses(Dest: TList; const OrderID: string; var HasObjects: boolean); 410 429 begin 411 430 CallV('ORWDX LOADRSP', [OrderID]); 412 ExtractToResponses(Dest );431 ExtractToResponses(Dest, HasObjects); 413 432 end; 414 433 … … 427 446 Param[1].Value := IntToStr(Encounter.Provider); 428 447 Param[2].PType := literal; 448 (*if loc > 0 then Param[2].Value := IntToStr(Loc) 449 else Param[2].Value := IntToStr(Encounter.Location);*) 429 450 Param[2].Value := IntToStr(Encounter.Location); 430 451 Param[3].PType := literal; … … 659 680 end; 660 681 682 function IsPFSSActive: boolean; 683 begin 684 with uPFSSActive do 685 if not PFSSChecked then 686 begin 687 PFSSActive := (sCallV('ORWPFSS IS PFSS ACTIVE?', [nil]) = '1'); 688 PFSSChecked := True; 689 end; 690 Result := uPFSSActive.PFSSActive 691 end; 661 692 662 693 { Medication Calls }
Note:
See TracChangeset
for help on using the changeset viewer.