Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/Orders/rOrders.pas

    r459 r460  
    3838    ParentID    : string;
    3939    LinkObject:   TObject;
     40    EnteredInError:     Integer; //AGP Changes 26.12 PSI-04-053
    4041    procedure Assign(Source: TOrder);
    4142    procedure Clear;
     
    604605    DGroupSeq  := SeqOfDGroup(DGroup);
    605606    DGroupName := TopNameOfDGroup(DGroup);
     607    //AGP Changes 26.15 PSI-04-063
     608    if (pos('Entered in error',Text)>0) then AnOrder.EnteredInError := 1
     609    else AnOrder.EnteredInError := 0;
    606610    //if DGroupName = 'Non-VA Meds' then Text := 'Non-VA  ' + Text;
    607611  end;
     
    680684  with RPCBrokerV do for i := 1 to Results.Count - 1 do   // if orders found (skip 0 element)
    681685  begin
    682     if (Piece(RPCBrokerV.Results[i], U, 1) = '0') or (Piece(RPCBrokerV.Results[i], U, 1) = '') then Continue;
    683     if (DelimCount(Results[i],U) = 2) then Continue;
     686    if (Piece(RPCBrokerV.Results[i], U, 1) = '0') or (Piece(RPCBrokerV.Results[i], U, 1) = '') then Continue; 
     687    if (DelimCount(Results[i],U) = 2) then Continue; 
    684688    AnOrder := TOrder.Create;
    685689    with AnOrder do
     
    11261130var
    11271131  DelayEvent, x, TheOrder: string;
    1128   Idx,PickupIdx, ForIMOResponses: integer;
     1132  Idx, tmpOrderGroup, PickupIdx, ForIMOResponses: integer;
    11291133  IfUDGrp: Boolean;
    11301134  IfUDGrpForQO: Boolean;
     1135  temp: string;
    11311136begin
    11321137  ForIMOResponses := 0;
     1138  tmpOrderGroup := 0;
     1139  temp := '';
    11331140  if ForIMO then ForIMOResponses := 1;
    11341141  PickupIdx := 0;
     
    11391146  begin
    11401147    Delete(TheOrder,1,1);
    1141     if CheckOrderGroup(TheOrder)=1 then IfUDGrp := True else IfUDGrp := False;
     1148    tmpOrderGroup := CheckOrderGroup(TheOrder);
     1149    if tmpOrderGroup = 1 then IfUDGrp := True else IfUDGrp := False;
    11421150  end;
    11431151  if (not IfUDGrp) and (AnEvent.EventType in ['A','T']) then
    11441152    IfUDGrp := True;
    11451153  //FLDS=DFN^LOC^ORNP^INPT^SEX^AGE^EVENT^SC%^^^Key Variables
     1154  if (Patient.Inpatient = true) and (tmpOrderGroup = 2) then temp := '0';
     1155  if temp <> '0' then temp := BoolChars[Patient.Inpatient];
    11461156  with AnEvent do
    11471157  begin
     
    14511461
    14521462    with RPCBrokerV do
    1453        begin
    1454          ClearParameters := True;
    1455          RemoteProcedure := 'ORWDXR RENEW';
    1456          Param[0].PType := literal;
    1457          Param[0].Value := AnOrder.ID;
    1458          Param[1].PType := literal;
    1459          Param[1].Value := Patient.DFN;
    1460          Param[2].PType := literal;
    1461          Param[2].Value := IntToStr(Encounter.Provider);
    1462          Param[3].PType := literal;
    1463          Param[3].Value := IntToStr(Encounter.Location);
    1464          Param[4].PType := list;
    1465 
    1466          for i := 0 to tmplst.Count - 1 do
    1467            Param[4].Mult[IntToStr(i+1)] := tmplst[i];
    1468 
    1469          Param[4].Mult['"ORCHECK"'] := IntToStr(OCList.Count);
    1470 
    1471          for i := 0 to OCList.Count - 1 do
    1472          begin
    1473            // put quotes around everything to prevent broker from choking
    1474            y := '"ORCHECK","' + Piece(OCList[i], U, 1) + '","' + Piece(OCList[i], U, 3) + '","' + IntToStr(i+1) + '"';
    1475            Param[4].Mult[y] := Pieces(OCList[i], U, 2, 4);
    1476          end;
    1477          Param[5].PType := literal;
    1478          Param[5].Value := IntToStr(IsComplex);
    1479          Param[6].PType := literal;
    1480          Param[6].Value := FloatToStr(AnIMOOrderAppt);
    1481 
     1463    begin
     1464      ClearParameters := True;
     1465      RemoteProcedure := 'ORWDXR RENEW';
     1466      Param[0].PType := literal;
     1467      Param[0].Value := AnOrder.ID;
     1468      Param[1].PType := literal;
     1469      Param[1].Value := Patient.DFN;
     1470      Param[2].PType := literal;
     1471      Param[2].Value := IntToStr(Encounter.Provider);
     1472      Param[3].PType := literal;
     1473      Param[3].Value := IntToStr(Encounter.Location);
     1474      Param[4].PType := list;
     1475      for i := 0 to tmplst.Count - 1 do
     1476        Param[4].Mult[IntToStr(i+1)] := tmplst[i];
     1477      Param[4].Mult['"ORCHECK"'] := IntToStr(OCList.Count);
     1478      for i := 0 to OCList.Count - 1 do
     1479      begin
     1480      // put quotes around everything to prevent broker from choking
     1481      y := '"ORCHECK","' + Piece(OCList[i], U, 1) + '","' + Piece(OCList[i], U, 3) +
     1482        '","' + IntToStr(i+1) + '"';
     1483      Param[4].Mult[y] := Pieces(OCList[i], U, 2, 4);
     1484    end;
     1485    Param[5].PType := literal;
     1486    Param[5].Value := IntToStr(IsComplex);
     1487    Param[6].PType := literal;
     1488    Param[6].Value := FloatToStr(AnIMOOrderAppt);
    14821489    CallBroker;
    14831490    SetOrderFromResults(AnOrder);
     
    15101517  CallV('ORWDXA DCREASON', [nil]);
    15111518  ExtractItems(Dest, RPCBrokerV.Results, 'DCReason');
    1512   DefaultIEN := StrToIntDef(Piece(ExtractDefault(RPCBrokerV.Results, 'DCReason'), U, 1), 0);
     1519  //AGP Change 26.15 for PSI-04-63
     1520  //DefaultIEN := StrToIntDef(Piece(ExtractDefault(RPCBrokerV.Results, 'DCReason'), U, 1), 0);
    15131521end;
    15141522
     
    15281536  SetOrderFromResults(AnOrder);
    15291537  AnOrder.ParentID := AParentID;
    1530 
    15311538end;
    15321539
Note: See TracChangeset for help on using the changeset viewer.