Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/fReview.pas

    r830 r1679  
    255255  Result := True;
    256256  if Changes.Count = 0 then Exit;
     257  if assigned(frmReview) then Exit;
    257258  frmReview := TfrmReview.Create(Application);
    258259  try
     
    299300   Changes.OnRemove := nil;     {**RV**}
    300301   frmReview.Release;
     302   frmReview := nil;
    301303  end;
    302304end;
     
    406408  PrevGrpName, temp: string;
    407409  displayHeader, displaySpacer, otherUserOrders: boolean;
    408 
     410  I, ColHeight: Integer;
    409411begin
    410412  tempOrderList := TStringList.Create;
     
    503505            end;
    504506        end;
     507    OrderGrp.Sorted := false;
    505508  end; {if Orders}
    506509    // determine the appropriate panel to display
     
    592595    end;
    593596  end;
     597
     598  if lstReview.Count > 0 then begin
     599   for I := 1 to lstReview.Count - 1 do begin
     600    lstReviewMeasureItem(lstReview, I, ColHeight);
     601    lstReview.Perform(LB_SETITEMHEIGHT,I,ColHeight);
     602   end;
     603  end;
     604  RedrawWindow(lstReview.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN);
     605
    594606end; {BuildFullList}
    595607
     
    891903  OrderList, OrderPrintList: TStringList;
    892904  SaveCoPay: boolean;
    893   DigSigErr, DigStoreErr, CryptoChecked, displayEncSwitch: Boolean;
     905  DigSigErr, DigStoreErr, CryptoChecked, displayEncSwitch, DelayOnly: Boolean;
    894906  SigData, SigUser, SigDrugSch, SigDEA: string;
    895907  cSignature, cHashData, cCrlUrl, cErr, WardName, ASvc: string;
    896908  cProvDUZ: Int64;
    897   AList, ClinicList, DCList, WardList: TStringList;
     909  AList, ClinicList, WardList: TStringList;
    898910  IsOk, ContainsIMOOrders, DoNotPrint : Boolean;
    899   EncLocName, EncLocText: string;
     911  EncLocName, EncLocText, tempInpLoc: string;
    900912  EncLocIEN: integer;
    901913  EncDT: TFMDateTime;
     
    943955  EncLocIEN := 0;
    944956  DoNotPrint := False;
     957  tempInpLoc := '';
     958  DelayOnly := false;
    945959  if BILLING_AWARE then
    946960  begin
     
    12221236          if (cmdOk.Caption = 'Sign') or (cmdOK.Caption = 'OK') and (not frmFrame.TimedOut) then
    12231237          begin
    1224              if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or
     1238             tempInpLoc := frmPrintLocation.rpcIsPatientOnWard(patient.dfn);
     1239             if ((Patient.Inpatient = false) and (tempInpLoc <> '')) or
    12251240                 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or
    12261241                 ((Patient.Inpatient = True) and (Encounter.Location = Patient.Location) and
    1227                  (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) then
    1228                  //or ((frmFrame.DoNotChangeEncWindow = true) and (encounter.Location  = uCore.TempOutEncounterLoc)) then
     1242                 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0))
     1243                 or((Patient.Inpatient) and (tempInpLoc <> '') and (Piece(tempInpLoc, U, 2) <> InttoStr(Encounter.location))) then
    12291244             begin
    1230                  if Encounter.Location <> Patient.Location then
     1245                 if (Encounter.Location <> Patient.Location) or
     1246                     ((tempInpLoc <> '') and ((InttoStr(Encounter.location)) <> (Piece(tempInpLoc,U,2)))) then
    12311247                   begin
    12321248                     EncLocName := Encounter.LocationName;
     
    12461262                 if frmFrame.mnuFile.Tag = 0 then displayEncSwitch := false
    12471263                 else displayEncSwitch := true;
    1248 
    1249                  (*displayEncSwitch := False;
    1250                  if (frmFrame.mnuFile.Items[frmFrame.mnuFile.menuIndex].Caption = 'Refresh Patient &Information') or
    1251                  (frmFrame.mnuFile.Items[frmFrame.mnuFile.menuIndex].Caption = '&Review/Sign Changes...') then
    1252                       displayEncSwitch := True;    *)
    1253                  DCList := TStringList.Create;
     1264                 if Encounter.Location = 0  then
     1265                   begin
     1266                     DisplayEncSwitch := True;
     1267                     DelayOnly := True;
     1268                   end;
    12541269                 for i := 0 to lstReview.Items.Count-1 do
    12551270                   begin
     1271                    //disregard orders that are not signed
    12561272                    if (lstReview.Checked[i] = false) and (lstReview.State[i] <> cbGrayed) then continue;
    12571273                    TempChangeItem := TChangeItem(lstReview.Items.Objects[i]);
     1274                    //DC Orders should print at the ward location
    12581275                    if TempChangeItem.DCOrder = True then
    12591276                      begin
    1260                         DCList.Add(tempChangeItem.ID);
     1277                        WardList.Add(tempChangeItem.ID);
    12611278                        continue;
    12621279                      end;
     1280                    //disregard Non-VA Meds orders
    12631281                    if TempChangeItem.OrderDG = NONVAMEDGROUP then continue;
    12641282                    if TempChangeItem.OrderDG = 'Clinic Orders' then ContainsIMOORders := true;
    12651283                    if (tempChangeItem.OrderDG = '') then continue;
     1284                    //Delay orders should be printed when the order is release to service not when the order is sign
    12661285                    if tempChangeItem.Delay = True then continue;
    12671286                    OrderPrintList.Add(tempChangeItem.ID + ':' + tempChangeItem.Text);
    1268                   end;
    1269                   if OrderPrintList.Count > 0 then
     1287                   end;
     1288                 if (OrderPrintList.Count > 0) and (DelayOnly = False) then
    12701289                    frmPrintLocation.PrintLocation(OrderPrintList, EncLocIEN, EncLocName, EncLocText, EncDT, EncVC, ClinicList,
    12711290                                                   WardList, wardIEN, wardName, ContainsIMOOrders, displayEncSwitch)
    1272                   else
     1291                  //Only Display encounter switch form if staying in the patient chart
     1292                  else if displayEncSwitch = true then
    12731293                    begin
    1274                     frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC);
    1275                     fframe.frmFrame.OrderPrintForm := True;
    1276                     DoNotPrint := True;
     1294                      frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC);
     1295                      fframe.frmFrame.OrderPrintForm := True;
     1296                      DoNotPrint := True;
    12771297                    end;
    1278 
    1279                   if DCList.Count > 0 then
    1280                     begin
    1281                        for i := 0 to DCList.Count - 1 do
    1282                          WardList.Add(DCList.Strings[i]);
    1283                        if (WardIEN = 0) and (WardName = '') then
    1284                           CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc);
    1285                     end;
    1286                   if DCList <> nil then DCList.Free;                 
    1287                end;
    1288           end;
    1289           if (cmdOk.Caption = 'Don''t Sign') and (not frmFrame.TimedOut) then
     1298                 if (WardIEN = 0) and (WardName = '') then CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc);
     1299                  //All other scenarios should not print
     1300                 if (ClinicList.count = 0) and (WardList.count = 0) then DoNotPrint := True;
     1301             end;
     1302          end; //CmdOK.Caption = Sign
     1303          if (cmdOk.Caption = 'Don''t Sign') and (not frmFrame.TimedOut) and (frmFrame.mnuFile.Tag <> 0) then
    12901304               begin
    1291                   if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or
     1305                 tempInpLoc := frmPrintLocation.rpcIsPatientOnWard(patient.dfn);
     1306                 if ((Patient.Inpatient = false) and (tempInpLoc <> '')) or
    12921307                 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or
    12931308                 ((Patient.Inpatient = True) and (Encounter.Location = Patient.Location) and
    1294                  (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) then
    1295                  //or ((frmFrame.DoNotChangeEncWindow = true) and (encounter.Location  = uCore.TempOutEncounterLoc)) then
     1309                 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0))
     1310                 or((Patient.Inpatient) and (tempInpLoc <> '') and (Piece(tempInpLoc, U, 2) <> InttoStr(Encounter.location))) then
    12961311                    begin
    1297                       if Encounter.Location <> Patient.Location then
     1312                      if (Encounter.Location <> Patient.Location) or
     1313                          ((tempInpLoc <> '') and ((InttoStr(Encounter.location)) <> (Piece(tempInpLoc,U,2)))) then
    12981314                        begin
    12991315                          EncLocName := Encounter.LocationName;
     
    13171333          uCore.TempEncounterLoc := 0;
    13181334          uCore.TempEncounterLocName := '';
     1335          tempInpLoc := '';
    13191336        end;
    13201337        //hds7591  Clinic/Ward movement.
     
    13241341          SendOrders(OrderList, ESCode);   {*KCM*}
    13251342
     1343      //CQ #15813 Modired code to look for error string mentioned in CQ and change strings to conts - JCS
    13261344        with OrderList do for i := 0 to Count - 1 do
    13271345        begin
     
    13311349            if not FSilent then
    13321350              begin
    1333                 if Piece(OrderList[i],U,4) = 'Invalid Pharmacy order number' then
     1351                if Piece(OrderList[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then
    13341352                  InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text + CRLF + CRLF +
    1335                         'The changes to this order have not been saved.  You must contact Pharmacy to complete any action on this order.',
    1336                         TC_SAVERR, MB_OK)
    1337                else
     1353                        TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK)
     1354                else if Piece(OrderList[i],U,4) = TX_SAVERR_IMAGING_PROC_SEARCH_STRING then
     1355                  InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text + CRLF + CRLF +
     1356                        TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK)
     1357                else
    13381358                 InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text,
    13391359                    TC_SAVERR, MB_OK);
     
    13661386          if (ClinicList.Count > 0) or (WardList.Count > 0) then
    13671387                PrintOrdersOnSignReleaseMult(OrderList, CLinicList, WardList, Nature, EncLocIEN, WardIEN, EncLocName, wardName)
    1368           else if DoNotPrint = false then PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc);
     1388          else if DoNotPrint = False then PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc);
    13691389        end;
    13701390        StatusText('');
     
    14651485  begin
    14661486    ARect := ItemRect(Index);
     1487    ARect.Left := lstReview.CheckWidth;
    14671488    Canvas.FillRect(ARect);
    14681489    x := FilteredString(Items[Index]);
     
    20332054  if (lstReview.Top + lstReview.Height) > BottomEdge then
    20342055    lstReview.Height := BottomEdge - lstReview.Top;
    2035               //INITIALIZATIONS
     2056   
     2057     //INITIALIZATIONS
    20362058      Paste1.Enabled := false;
    20372059      fReview.srcOrderID := '';
     
    21652187
    21662188procedure TfrmReview.FormResize(Sender: TObject);
     2189VAR
     2190 I, ColHeight: Integer;
    21672191begin
    21682192  inherited;
    2169   lstReview.Invalidate;
     2193  if lstReview.Count > 0 then begin
     2194   for I := 1 to lstReview.Count - 1 do begin
     2195    lstReviewMeasureItem(lstReview, I, ColHeight);
     2196    lstReview.Perform(LB_SETITEMHEIGHT,I,ColHeight);
     2197   end;
     2198  end;
     2199  RedrawWindow(lstReview.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN);
    21702200end;
    21712201
Note: See TracChangeset for help on using the changeset viewer.