Ignore:
Timestamp:
Jul 7, 2010, 4:51:54 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrading to version 27

File:
1 edited

Legend:

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

    r456 r830  
    99  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    1010  StdCtrls, checklst, uConst, ExtCtrls, uCore, mCoPayDesc, XUDIGSIGSC_TLB,
    11   ORCtrls, Menus, UBACore, ORClasses;
     11  ORCtrls, Menus, UBACore, ORClasses,fBase508Form, fPrintLocation,
     12  VA508AccessibilityManager;
    1213
    1314type
    14   TfrmReview = class(TForm)
     15  TfrmReview = class(TfrmBase508Form)
    1516    cmdOK: TButton;
    1617    cmdCancel: TButton;
     
    6566      X, Y: Integer);
    6667    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    67     procedure fraCoPayLabel23Enter(Sender: TObject);
    68     procedure fraCoPayLabel23Exit(Sender: TObject);
    6968    procedure lstReviewKeyUp(Sender: TObject; var Key: Word;
    7069      Shift: TShiftState);
    7170    procedure FormKeyUp(Sender: TObject; var Key: Word;
    7271      Shift: TShiftState);
     72    procedure FormResize(Sender: TObject);
    7373
    7474  private
     
    9494    function IsSignatureRequired:boolean;
    9595    function GetNumberOfSelectedOrders : byte;
    96     procedure  ShowTreatmentFactorHints(var pHintText: string; var pCompName: TORStaticText); // 508
     96    procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText); // 508
    9797    procedure SetItemTextToState;
    9898    procedure FormatListForScreenReader;
     
    137137uses ORFn, rCore, fNotes, fConsults, fOrders, rOrders, Hash, fDCSumm, fOCSession, uOrders,
    138138     fSignItem, fOrdersPrint, fLkUpLocation, fFrame, uSignItems, fSurgery,
    139      fBALocalDiagnoses, UBAConst, UBAMessages, fOrdersSign, fClinicWardMeds;
     139     fBALocalDiagnoses, UBAConst, UBAMessages, fOrdersSign, fClinicWardMeds,
     140     rODLab, fRptBox, VAUtils;
    140141
    141142const
     
    250251{ display changes made to chart for this encounter, allow changes to be saved, signed, etc. }
    251252var
    252     i: integer;
     253  i: integer;
    253254begin
    254255  Result := True;
     
    361362  if ChangeItem.GroupName = '' then
    362363  begin
    363   if StrPos(PChar(ChangeItem.Text),PChar(NonVAMedTxt)) <> nil then
     364  //if StrPos(PChar(ChangeItem.Text),PChar(NonVAMedTxt)) <> nil then
     365  if ChangeItem.OrderDG = NONVAMEDGROUP then
    364366         lstReview.State[Result] := cbGrayed;
    365367   end;
     
    402404  ChangeItem: TChangeItem;
    403405  LabelHeight: integer;
    404   PrevGrpName: string;
     406  PrevGrpName, temp: string;
     407  displayHeader, displaySpacer, otherUserOrders: boolean;
    405408
    406409begin
     
    442445  if(FullList) then
    443446  begin
     447    //otherUserOrders := False;
     448    displaySpacer := False;
    444449    with Changes do
    445450    if Orders.Count > 0 then
    446451    begin
    447 
     452      OrderGrp.Sorted := True;
     453      otherUserOrders := False;
    448454      for GrpIndex := 0 to OrderGrp.Count - 1 do
    449455      begin
     456        displayHeader := True;
    450457        if (GrpIndex > 0 ) and (AnsiCompareText(PrevGrpName,OrderGrp[GrpIndex])=0) then
    451458          Continue;
    452         AddHeader('Orders - ' + OrderGrp[GrpIndex]);
     459        if OrderGrp[GrpIndex] = '' then Temp := 'My Unsigned Orders - This Session'
     460        else if OrderGrp[GrpIndex] = 'Other Unsigned' then Temp := 'My Unsigned Orders - Previous Sessions'
     461        else Temp := 'Orders - ' + OrderGrp[GrpIndex];
     462        //AddHeader('Orders - ' + Temp);
    453463        {billing aware}
    454464        if BILLING_AWARE then
     
    461471        begin
    462472          ChangeItem := Orders[ChgIndex];
    463           if ChangeItem.GroupName = OrderGrp[GrpIndex] then
     473          if (ChangeItem.GroupName = OrderGrp[GrpIndex]) and ((ChangeItem.User = 0) or (ChangeItem.User = User.DUZ)) then
    464474          begin
     475            if displayHeader = True then
     476              begin
     477                AddHeader(Temp);
     478                displayHeader := False;
     479                displaySpacer := True;
     480              end;
    465481            lbIdx := AddItem(ChangeItem);
    466482            SigItems.Add(CH_ORD, ChangeItem.ID, lbIdx);
    467          end;
     483         end
     484         else if ((ChangeItem.User > 0) and (ChangeItem.User <> User.DUZ)) then
     485           otherUserOrders := True;
    468486        end;
    469         AddHeader('   ');
     487        if displayHeader = False then AddHeader('   ');
    470488        PrevGrpName := OrderGrp[GrpIndex];
    471       end;
    472     end; {if Orders}
     489    end;
     490    //AGP fix for CQ 10073
     491    if otherUserOrders = True then
     492          begin
     493            if displaySpacer = True then AddHeader('   ');
     494            AddHeader('Others'' Unsigned Orders Orders - All Sessions');
     495            for ChgIndex := 0 to Orders.Count - 1 do
     496             begin
     497                ChangeItem := Orders[ChgIndex];
     498                if (ChangeItem.GroupName = 'Other Unsigned') and ((ChangeItem.User >0) and (ChangeItem.User <> User.DUZ)) then
     499                  begin
     500                    lbIdx := AddItem(ChangeItem);
     501                    SigItems.Add(CH_ORD, ChangeItem.ID, lbIdx);
     502                  end;
     503            end;
     504        end;
     505  end; {if Orders}
    473506    // determine the appropriate panel to display
    474507    case User.OrderRole of
     
    659692var
    660693  x: string;
    661   ARect: TRect;
    662   i: integer;
     694  ARect, TextRecord: TRect;
     695  i, dy: integer;
    663696  tempID: string;
    664697  thisRec: UBAGlobals.TBADxRecord;
     
    668701{End BillingAware}
    669702
     703  procedure UpdateTextRecord(r: TRect);
     704  begin
     705    TextRecord := r;
     706    inc(TextRecord.Top, dy);
     707    dec(TextRecord.Bottom, dy);
     708  end;
     709
    670710begin
    671711  inherited;
    672 
     712  dy := SIG_ITEM_VERTICAL_PAD div 2;
    673713  x := '';
    674714  ARect := Rect;
     
    682722    if Items.Objects[Index] = nil then
    683723        ARect.Left := 0;
    684     Canvas.Pen.Color := clSilver;
    685     //Canvas.Brush.Color := clLime;
     724    Canvas.Pen.Color := Get508CompliantColor(clSilver);
     725    //Canvas.Brush.Color := Get508CompliantColor(clLime);
    686726    Canvas.FillRect(ARect);
    687727
     
    691731
    692732       if (ARect.Left = 0) and ( Length(x)>0 ) then
    693          Canvas.TextOut(ARect.Left + 2, ARect.Top, x)
     733         Canvas.TextOut(ARect.Left + 2, ARect.Top + dy, x)
    694734       else
    695735          if (ARect.Left > 0 ) and ( Length(x)>0 ) then
     
    706746
    707747             //Draw ORDER TEXT
    708             DrawText(Canvas.handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     748            UpdateTextRecord(ARect);
     749            DrawText(Canvas.handle, PChar(x), Length(x), TextRecord, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    709750
    710751           if  BILLING_AWARE then
    711                       begin
     752                begin
    712753                     //Dx Column lines
    713                      Canvas.Pen.Color := clSilver;
     754                     Canvas.Pen.Color := Get508CompliantColor(clSilver);
    714755                     Canvas.MoveTo(DxRect.Left-1, ARect.Top);
    715756                     Canvas.LineTo(DxRect.Left-1, ARect.Bottom);
    716757                     //Adjust position of 'Diagnosis' column label for font size
    717758                     laDiagnosis.Left := DxRect.Left + 14;
     759                     if uSignItems.GetAllBtnLeftPos > 0 then
     760                        laDiagnosis.left := uSignItems.GetAllBtnLeftPos - (laDiagnosis.Width +5);
    718761                     laDiagnosis.Top := lblSig.Top;
    719762                     //Assign DxRect for drawing Dx column and Dx string
     
    742785                                    str := Piece(thisRec.FBADxCode, '^', 1); // Display Dx text only - not the ICD-9 code
    743786                                    str := Piece(str, ':', 1);   //in case has : vs. ^
    744                                     DrawText(Canvas.handle, PChar(str), Length(str), arRect[Index], DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     787                                    UpdateTextRecord(arRect[Index]);
     788                                    DrawText(Canvas.handle, PChar(str), Length(str), TextRecord, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    745789
    746790                                    if (Not UBACore.IsOrderBillable(tempID)) then// and
    747791                               //        (Not UBAGlobals.tempDxNodeExists(tempID) ) then  // if consult is non cidc but requires dx, show it.
    748792                                    begin
    749                                        Canvas.Font.Color := clBlue ;
    750                                        DrawText(Canvas.handle, PChar(NOT_APPLICABLE), Length(NOT_APPLICABLE) , arRect[Index], DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     793                                       Canvas.Font.Color := Get508CompliantColor(clBlue);
     794                                       UpdateTextRecord(arRect[Index]);
     795                                       DrawText(Canvas.handle, PChar(NOT_APPLICABLE), Length(NOT_APPLICABLE) , TextRecord, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    751796                                    end;
    752797                                 end
     
    756801                                    if Not UBACore.IsOrderBillable(tempID) then
    757802                                    begin
    758                                         Canvas.Font.Color := clBlue ;
    759                                         DrawText(Canvas.handle, PChar(NOT_APPLICABLE), Length(NOT_APPLICABLE) , arRect[Index], DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     803                                        Canvas.Font.Color := Get508CompliantColor(clBlue);
     804                                        UpdateTextRecord(arRect[Index]);
     805                                        DrawText(Canvas.handle, PChar(NOT_APPLICABLE), Length(NOT_APPLICABLE) , TextRecord, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    760806                                    end;
    761807                                 end;
     
    780826
    781827             if (ARect.Left = 0) and ( Length(x) > 0 ) then
    782                 Canvas.TextOut(ARect.Left + 2, ARect.Top, x)
     828                Canvas.TextOut(ARect.Left + 2, ARect.Top + dy, x)
    783829             else
    784830                if (ARect.Left > 0 ) and ( Length(x)>0 ) then
    785831                   begin
    786                      Canvas.Pen.Color := clSilver;
     832                     Canvas.Pen.Color := Get508CompliantColor(clSilver);
    787833                     Canvas.MoveTo(0, ARect.Bottom-1);
    788834                     Canvas.LineTo(ARect.Right, ARect.Bottom-1);
    789                      DrawText(Canvas.handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     835                     UpdateTextRecord(ARect);
     836                     DrawText(Canvas.handle, PChar(x), Length(x), TextRecord, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    790837                   end;
    791838             end;
     
    838885  TC_SAVERR  = 'Error Saving Order';
    839886var
    840   i, idx, AType, PrintLoc, theSts: Integer;
     887  i, idx, AType, PrintLoc, theSts, wardIEN: Integer;
    841888  SigSts, RelSts, Nature: Char;
    842889  ESCode, AnID, AnErrMsg: string;
    843   ChangeItem: TChangeItem;
    844   OrderList: TStringList;
     890  ChangeItem, TempChangeItem: TChangeItem;
     891  OrderList, OrderPrintList: TStringList;
    845892  SaveCoPay: boolean;
    846   DigSigErr, DigStoreErr, CryptoChecked: Boolean;
     893  DigSigErr, DigStoreErr, CryptoChecked, displayEncSwitch: Boolean;
    847894  SigData, SigUser, SigDrugSch, SigDEA: string;
    848   cSignature, cHashData, cCrlUrl, cErr: string;
     895  cSignature, cHashData, cCrlUrl, cErr, WardName, ASvc: string;
    849896  cProvDUZ: Int64;
     897  AList, ClinicList, DCList, WardList: TStringList;
     898  IsOk, ContainsIMOOrders, DoNotPrint : Boolean;
     899  EncLocName, EncLocText: string;
     900  EncLocIEN: integer;
     901  EncDT: TFMDateTime;
     902  EncVC: Char;
    850903
    851904  function OrdersSignedOrReleased: Boolean;
     
    884937
    885938begin
     939  IsOk := True;
    886940  ESCode := '';
    887941  SaveCoPay := FALSE;
    888942  PrintLoc := 0;
     943  EncLocIEN := 0;
     944  DoNotPrint := False;
    889945  if BILLING_AWARE then
    890946  begin
     
    910966    { save/sign orders }
    911967    OrderList := TStringList.Create;
     968    OrderPrintList := TStringList.create;
     969    ClinicList := TStringList.Create;
     970    WardList := TStringList.Create;
    912971    DigSigErr := True;
    913972    CryptoChecked := False;
     973    ContainsIMOOrders := False;
    914974    try
    915975      Nature := NO_PROVIDER;
     
    10231083                                  if Length(SigData) < 1 then
    10241084                                    begin
    1025                                       ShowMessage(ChangeItem.Text + CRLF + CRLF + 'Digital Signature failed with reason: Unable to get required data from server');
     1085                                      ShowMsg(ChangeItem.Text + CRLF + CRLF + 'Digital Signature failed with reason: Unable to get required data from server');
    10261086                                      DigStoreErr := true;
    10271087                                    end;
     
    10451105                                    else
    10461106                                      begin
    1047                                         ShowMessage(ChangeItem.Text + CRLF + CRLF + 'Digital Signature failed with reason: '+ piece(Crypto.Reason, '^', 2));
     1107                                        ShowMsg(ChangeItem.Text + CRLF + CRLF + 'Digital Signature failed with reason: '+ piece(Crypto.Reason, '^', 2));
    10481108                                        DigStoreErr := true;
    10491109                                      end;
     
    10511111                                    on  E: Exception do
    10521112                                      begin
    1053                                         ShowMessage(ChangeItem.Text + CRLF + CRLF + 'Crypto raised an error: '+ E.Message);
     1113                                        ShowMsg(ChangeItem.Text + CRLF + CRLF + 'Crypto raised an error: '+ E.Message);
    10541114                                        DigStoreErr := true;
    10551115                                      end;
     
    10691129                                  if GetPKISite and (OrderRequiresDigitalSignature(ChangeItem.ID)) then
    10701130                                    begin
    1071                                       ShowMessage('ORDER NOT SENT TO PHARMACY' + CRLF + CRLF + ChangeItem.Text + CRLF + CRLF +
     1131                                      ShowMsg('ORDER NOT SENT TO PHARMACY' + CRLF + CRLF + ChangeItem.Text + CRLF + CRLF +
    10721132                                        'This Schedule II medication cannot be electronically entered without a Digital Signature. ' +
    10731133                                        CRLF + 'Please discontinue/cancel this order and create a hand written order for manual processing, or digitally sign the order at a PKI-enabled workstation.');
     
    11261186             else
    11271187             begin
    1128                 if BILLING_AWARE then
    1129                    InfoBox(TX_Order_Error, 'Review/Sign Orders', MB_OK)
    1130                    else
    1131                       InfoBox(TC_Order_Error, 'Review/Sign Orders', MB_OK);
     1188                InfoBox(TX_Order_Error, 'Review/Sign Orders', MB_OK);
    11321189                Exit;
    11331190             end
     
    11581215      if (User.OrderRole in [OR_NOKEY..OR_STUDENT]) and (OrderList.Count > 0) and LockedForOrdering then
    11591216      begin
    1160         ExecuteSessionOrderChecks(OrderList);  // any cancelled orders will be removed from OrderList
     1217        IsOk := ExecuteSessionOrderChecks(OrderList);  // any cancelled orders will be removed from OrderList
    11611218        StatusText('Sending Orders to Service(s)...');
    11621219        if OrderList.Count > 0 then
    11631220        begin
    1164 
    11651221        //hds7591  Clinic/Ward movement.  Nurse orders
    11661222          if (cmdOk.Caption = 'Sign') or (cmdOK.Caption = 'OK') and (not frmFrame.TimedOut) then
    11671223          begin
    1168              if IsValidIMOLoc(uCore.TempEncounterLoc,Patient.DFN) then
    1169                 frmClinicWardMeds.ClinicOrWardLocation(OrderList, uCore.TempEncounterLoc,uCore.TempEncounterLocName, PrintLoc)
    1170              else
    1171                 if (IsValidIMOLoc(Encounter.Location,Patient.DFN)) and ((frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN)) and (Patient.Inpatient = false)) then
    1172                    frmClinicWardMeds.ClinicOrWardLocation(OrderList, Encounter.Location,Encounter.LocationName, PrintLoc);
     1224             if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or
     1225                 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or
     1226                 ((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
     1229             begin
     1230                 if Encounter.Location <> Patient.Location then
     1231                   begin
     1232                     EncLocName := Encounter.LocationName;
     1233                     EncLocIEN  := Encounter.Location;
     1234                     EncLocText := Encounter.LocationText;
     1235                     EncDT := Encounter.DateTime;
     1236                     EncVC := Encounter.VisitCategory;
     1237                   end
     1238                 else
     1239                    begin
     1240                     EncLocName := UCore.TempEncounterLocName;
     1241                     EncLocIEN  := UCore.TempEncounterLoc;
     1242                     EncLocText := uCore.TempEncounterText;
     1243                     EncDT := uCore.TempEncounterDateTime;
     1244                     EncVC := uCore.TempEncounterVistCat;
     1245                    end;
     1246                 if frmFrame.mnuFile.Tag = 0 then displayEncSwitch := false
     1247                 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;
     1254                 for i := 0 to lstReview.Items.Count-1 do
     1255                   begin
     1256                    if (lstReview.Checked[i] = false) and (lstReview.State[i] <> cbGrayed) then continue;
     1257                    TempChangeItem := TChangeItem(lstReview.Items.Objects[i]);
     1258                    if TempChangeItem.DCOrder = True then
     1259                      begin
     1260                        DCList.Add(tempChangeItem.ID);
     1261                        continue;
     1262                      end;
     1263                    if TempChangeItem.OrderDG = NONVAMEDGROUP then continue;
     1264                    if TempChangeItem.OrderDG = 'Clinic Orders' then ContainsIMOORders := true;
     1265                    if (tempChangeItem.OrderDG = '') then continue;
     1266                    if tempChangeItem.Delay = True then continue;
     1267                    OrderPrintList.Add(tempChangeItem.ID + ':' + tempChangeItem.Text);
     1268                  end;
     1269                  if OrderPrintList.Count > 0 then
     1270                    frmPrintLocation.PrintLocation(OrderPrintList, EncLocIEN, EncLocName, EncLocText, EncDT, EncVC, ClinicList,
     1271                                                   WardList, wardIEN, wardName, ContainsIMOOrders, displayEncSwitch)
     1272                  else
     1273                    begin
     1274                    frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC);
     1275                    fframe.frmFrame.OrderPrintForm := True;
     1276                    DoNotPrint := True;
     1277                    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;
    11731288          end;
     1289          if (cmdOk.Caption = 'Don''t Sign') and (not frmFrame.TimedOut) then
     1290               begin
     1291                  if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or
     1292                 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or
     1293                 ((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
     1296                    begin
     1297                      if Encounter.Location <> Patient.Location then
     1298                        begin
     1299                          EncLocName := Encounter.LocationName;
     1300                          EncLocIEN  := Encounter.Location;
     1301                          EncLocText := Encounter.LocationText;
     1302                          EncDT := Encounter.DateTime;
     1303                          EncVC := Encounter.VisitCategory;
     1304                        end
     1305                      else
     1306                        begin
     1307                          EncLocName := UCore.TempEncounterLocName;
     1308                          EncLocIEN  := UCore.TempEncounterLoc;
     1309                          EncLocText := uCore.TempEncounterText;
     1310                          EncDT := uCore.TempEncounterDateTime;
     1311                          EncVC := uCore.TempEncounterVistCat;
     1312                        end;
     1313                        frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC);
     1314                        fframe.frmFrame.OrderPrintForm := True;
     1315                    end;
     1316               end;
    11741317          uCore.TempEncounterLoc := 0;
    11751318          uCore.TempEncounterLocName := '';
     
    11861329          begin
    11871330            ChangeItem := Changes.Locate(CH_ORD, Piece(OrderList[i], U, 1));
    1188             if not FSilent then InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text,
     1331            if not FSilent then
     1332              begin
     1333                if Piece(OrderList[i],U,4) = 'Invalid Pharmacy order number' then
     1334                  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
     1338                 InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text,
    11891339                    TC_SAVERR, MB_OK);
     1340              end;
    11901341          end;
    11911342          if Pos('R', Piece(OrderList[i], U, 2)) > 0 then
     
    12041355            if theSts = 10 then  OrderList.Delete(idx);  //signed delayed order should not be printed.
    12051356          end;
    1206           PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc);
     1357          //  CQ 10226, PSI-05-048 - advise of auto-change from LC to WC on lab orders
     1358          AList := TStringList.Create;
     1359          try
     1360            CheckForChangeFromLCtoWCOnRelease(AList, Encounter.Location, OrderList);
     1361            if AList.Text <> '' then
     1362              ReportBox(AList, 'Changed Orders', TRUE);
     1363          finally
     1364            AList.Free;
     1365          end;
     1366          if (ClinicList.Count > 0) or (WardList.Count > 0) then
     1367                PrintOrdersOnSignReleaseMult(OrderList, CLinicList, WardList, Nature, EncLocIEN, WardIEN, EncLocName, wardName)
     1368          else if DoNotPrint = false then PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc);
    12071369        end;
    12081370        StatusText('');
     
    12191381    finally
    12201382      FreeAndNil(OrderList);
     1383      FreeAndNil(OrderPrintList);
     1384      FreeAndNil(ClinicList);
     1385      FreeAndNil(WardList);
    12211386    end;
    12221387    crypto := nil;
     
    12621427  end;
    12631428  UnlockIfAble;
    1264   FOKPressed := True;
     1429  FOKPressed := IsOk;
    12651430  Close;
    12661431end;
     
    13021467    Canvas.FillRect(ARect);
    13031468    x := FilteredString(Items[Index]);
    1304     AHeight := WrappedTextHeightByFont( lstReview.Canvas, Font, x, ARect);
     1469    AHeight := WrappedTextHeightByFont( lstReview.Canvas, Font, x, ARect) + SIG_ITEM_VERTICAL_PAD;
    13051470    if AHeight > 255 then AHeight := 255;
    13061471    //-------------------
     
    13751540                          on EListError do
    13761541                             begin
    1377                              {$ifdef debug}ShowMessage('EListError in fReview.lstReviewMouseMove()');{$endif}
     1542                             {$ifdef debug}Show508Message('EListError in fReview.lstReviewMouseMove()');{$endif}
    13781543                             raise;
    13791544                             end;
     
    14391604              end;
    14401605          //*********************************
    1441             thisOrderID := TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]).ID;
     1606              thisOrderID := TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]).ID;
    14421607              {BAV25 Code} //Used to pass selected orders to Lookup DX form
    14431608              BAtmpOrderList.Add(TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]).TEXT);
     
    14681633     on EListError do
    14691634        begin
    1470         {$ifdef debug}ShowMessage('EListError in fReview.buDiagnosisClick()');{$endif}
     1635        {$ifdef debug}Show508Message('EListError in fReview.buDiagnosisClick()');{$endif}
    14711636        raise;
    14721637        end;
     
    14771642  if numSelected = 0 then
    14781643     begin
    1479      ShowMessage(UBAMessages.BA_NO_ORDERS_SELECTED);
     1644     ShowMsg(UBAMessages.BA_NO_ORDERS_SELECTED);
    14801645     Exit;
    14811646     end
     
    15911756     on EListError do
    15921757        begin
    1593         {$ifdef debug}ShowMessage('EListError in fReview.lstReviewClick()');{$endif}
     1758        {$ifdef debug}Show508Message('EListError in fReview.lstReviewClick()');{$endif}
    15941759        raise;
    15951760        end;
     
    16811846         if numSelected > 1 then
    16821847           begin
    1683            ShowMessage('Only 1 order at a time may be selected for ''Copying''');
     1848           ShowMsg('Only 1 order at a time may be selected for ''Copying''');
    16841849           Exit;
    16851850           end;
     
    17121877               if Not UBACore.IsOrderBillable(fReview.srcOrderID) then
    17131878                 begin
    1714                  ShowMessage(BA_NA_COPY_DISALLOWED);
     1879                 ShowMsg(BA_NA_COPY_DISALLOWED);
    17151880                 //Continue;
    17161881                 fReview.srcOrderID := '';
     
    17271892     on EListError do
    17281893        begin
    1729         {$ifdef debug}ShowMessage('EListError in fReview.Copy1Click()');{$endif}
     1894        {$ifdef debug}Show508Message('EListError in fReview.Copy1Click()');{$endif}
    17301895        raise
    17311896        end;
     
    17711936                  if (NOT UBACore.IsOrderBillable(fReview.targetOrderID) ) then
    17721937                   begin
    1773                     ShowMessage(BA_NA_PASTE_DISALLOWED);
     1938                    ShowMsg(BA_NA_PASTE_DISALLOWED);
    17741939                    fReview.targetOrderID := '';
    17751940                    Continue;
     
    18001965     on EListError do
    18011966        begin
    1802         {$ifdef debug}ShowMessage('EListError in fReview.Paste1Click()');{$endif}
     1967        {$ifdef debug}Show508Message('EListError in fReview.Paste1Click()');{$endif}
    18031968        raise;
    18041969        end;
     
    18281993     on EListError do
    18291994        begin
    1830         {$ifdef debug}ShowMessage('EListError in fReview.ClearDiagnoses1Click()');{$endif}
     1995        {$ifdef debug}Show508Message('EListError in fReview.ClearDiagnoses1Click()');{$endif}
    18311996        raise;
    18321997        end;
     
    18512016        Inc(howMany);
    18522017     end;
    1853 
    18542018  Result := howMany;
    18552019end;
     
    18572021procedure TfrmReview.FormShow(Sender: TObject);
    18582022var
    1859   numOrderItems: integer;
    1860 begin
    1861      //INITIALIZATIONS
    1862       Paste1.Enabled := false;
     2023  BottomEdge, numOrderItems: integer;
     2024begin
     2025  if pnlSignature.Visible then
     2026    BottomEdge := pnlSignature.Top
     2027  else
     2028  if pnlOrderAction.Visible then
     2029    BottomEdge := pnlOrderAction.Top
     2030  else
     2031    BottomEdge := cmdOK.Top;
     2032  dec(BottomEdge, 4);
     2033  if (lstReview.Top + lstReview.Height) > BottomEdge then
     2034    lstReview.Height := BottomEdge - lstReview.Top;
     2035              //INITIALIZATIONS
     2036      Paste1.Enabled := false;
    18632037      fReview.srcOrderID := '';
    18642038      fReview.srcDx := '';
    18652039
    1866      //begin BillingAware
    18672040     if  BILLING_AWARE then
    18682041        frmReview.lstReview.Multiselect := true;
    1869     //end BillingAware
    18702042
    18712043  FormatListForScreenReader;
     
    19052077  j: integer; //CQ5054
    19062078begin
     2079  inherited;
    19072080  currentlySelectedItem := frmReview.lstReview.ItemIndex; //CQ5063
    19082081
    19092082    case Key of
    1910         67,99:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSC,fraCoPay.Label24);  //C,c
    1911         86,118: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorCV,fraCoPay.staticText4);  //V,v
    1912         79,111: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorAO,fraCoPay.Label18); //O,o
    1913         82,114: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorIR,fraCoPay.Label16); //R,r
    1914         69,101: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorEC,fraCoPay.Label14); //E,e
    1915         77,109: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorMST,fraCoPay.Label12); //M,m
    1916         72,104: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorHNC,fraCoPay.lblHNC2); //H,h
     2083        67,99:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSC,fraCoPay.lblSC2); //C,c
     2084        86,118: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorCV,fraCoPay.lblCV2); //V,v
     2085        79,111: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorAO,fraCoPay.lblAO2); //O,o
     2086        82,114: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorIR,fraCoPay.lblIR2); //R,r
     2087        65,97:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorEC,fraCoPay.lblSWAC2); //A,a
     2088        77,109: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorMST,fraCoPay.lblMST2); //M,m
     2089        78,110: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorHNC,fraCoPay.lblHNC2); //N,n
     2090        72,104: if (ssALT in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSHAD,fraCopay.lblSHAD2); // H,h
    19172091        //CQ5054
    19182092        83,115: if (ssAlt in Shift) then
     
    19492123
    19502124//BILLING AWARE Procedure
    1951 procedure TfrmReview.ShowTreatmentFactorHints(var pHintText: string; var pCompName: TORStaticText); // 508
     2125procedure TfrmReview.ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText); // 508
    19522126var
    19532127 HRect: TRect;
     
    19732147   hrect.Bottom := hrect.Bottom + Y;
    19742148
    1975   if FRVTFHintWindowActive then
    1976      begin
    1977      with fraCoPay do
    1978         begin
    1979         //Abbreviated captions
    1980         Label23.ShowHint := false;
    1981         StaticText1.ShowHint := false;
    1982         Label17.ShowHint := false;
    1983         Label15.ShowHint := false;
    1984         Label13.ShowHint := false;
    1985         Label11.ShowHint := false;
    1986         lblHNC.ShowHint := false;
    1987         //Long captions
    1988         staticText4.ShowHint := false;
    1989         Label17.ShowHint := false;
    1990         Label18.ShowHint := false;
    1991         Label15.ShowHint := false;
    1992         Label16.ShowHint := false;
    1993         Label13.ShowHint := false;
    1994         Label14.ShowHint := false;
    1995         Label11.ShowHint := false;
    1996         Label12.ShowHint := false;
    1997         lblHNC.ShowHint := false;
    1998         lblHNC2.ShowHint := false;
    1999         end;
    2000      end
    2001   else
    2002      begin
    2003      with fraCoPay do
    2004         begin
    2005         //Abbreviated captions
    2006         Label23.ShowHint := true;
    2007         StaticText1.ShowHint := true;
    2008         Label17.ShowHint := true;
    2009         Label15.ShowHint := true;
    2010         Label13.ShowHint := true;
    2011         Label11.ShowHint := true;
    2012         lblHNC.ShowHint := true;
    2013         //Long captions       
    2014         staticText4.ShowHint := true;
    2015         Label17.ShowHint := true;
    2016         Label18.ShowHint := true;
    2017         Label15.ShowHint := true;
    2018         Label16.ShowHint := true;
    2019         Label13.ShowHint := true;
    2020         Label14.ShowHint := true;
    2021         Label11.ShowHint := true;
    2022         Label12.ShowHint := true;
    2023         lblHNC.ShowHint := true;
    2024         lblHNC2.ShowHint := true;
    2025         end;
    2026      end;
     2149   fraCoPay.LabelCaptionsOn(not FRVTFHintWindowActive);
    20272150
    20282151   FRVTFHintWindow.ActivateHint(hrect, pHintText);
     
    20342157  Y: Integer);
    20352158begin
    2036 //  IF BILLING_AWARE then
    20372159    if FRVTFHintWindowActive then
    20382160    begin
     
    20422164end;
    20432165
     2166procedure TfrmReview.FormResize(Sender: TObject);
     2167begin
     2168  inherited;
     2169  lstReview.Invalidate;
     2170end;
     2171
    20442172procedure TfrmReview.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    20452173begin
     
    20542182procedure TfrmReview.fraCoPayLabel24MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    20552183begin
    2056   if FRVTFHintWindowActive then
    2057      begin
    2058      with fraCoPay do
    2059         begin
    2060         //Abbreviated captions
    2061           Label23.ShowHint := false;
    2062           StaticText1.ShowHint := false;
    2063           Label17.ShowHint := false;
    2064           Label15.ShowHint := false;
    2065           Label13.ShowHint := false;
    2066           Label11.ShowHint := false;
    2067           lblHNC.ShowHint := false;
    2068         //Long captions
    2069           Label24.ShowHint := false;
    2070           staticText4.ShowHint := false;
    2071           Label17.ShowHint := false;
    2072           Label18.ShowHint := false;
    2073           Label15.ShowHint := false;
    2074           Label16.ShowHint := false;
    2075           Label13.ShowHint := false;
    2076           Label14.ShowHint := false;
    2077           Label11.ShowHint := false;
    2078           Label12.ShowHint := false;
    2079           lblHNC.ShowHint := false;
    2080           lblHNC2.ShowHint := false;
    2081         end;
    2082      end
    2083   else
    2084      begin
    2085      with fraCoPay do
    2086         begin
    2087         //Abbreviated captions
    2088           Label23.ShowHint := true;
    2089           StaticText1.ShowHint := true;
    2090           Label17.ShowHint := true;
    2091           Label15.ShowHint := true;
    2092           Label13.ShowHint := true;
    2093           Label11.ShowHint := true;
    2094           lblHNC.ShowHint := true;
    2095           //Long captions
    2096           Label24.ShowHint := true;
    2097           staticText4.ShowHint := true;
    2098           Label17.ShowHint := true;
    2099           Label18.ShowHint := true;
    2100           Label15.ShowHint := true;
    2101           Label16.ShowHint := true;
    2102           Label13.ShowHint := true;
    2103           Label14.ShowHint := true;
    2104           Label11.ShowHint := true;
    2105           Label12.ShowHint := true;
    2106           lblHNC.ShowHint := true;
    2107           lblHNC2.ShowHint := true;
    2108         end;
    2109      end;
     2184  fraCoPay.LabelCaptionsOn(not FRVTFHintWindowActive);
    21102185end;
    21112186
     
    21202195      with fraCopay do
    21212196        begin
    2122           Label24.ShowHint := false;
    2123           staticText4.ShowHint := false;
    2124           Label18.ShowHint := false;
    2125           Label16.ShowHint := false;
    2126           Label14.ShowHint := false;
    2127           Label12.ShowHint := false;
    2128           lblHNC2.ShowHint := false;
     2197        //Long captions
     2198        lblSC.ShowHint := false;
     2199        lblCV.ShowHint := false;
     2200        lblAO.ShowHint := false;
     2201        lblIR.ShowHint := false;
     2202        lblSWAC.ShowHint := false;
     2203        lblHNC.ShowHint  := false;
     2204        lblHNC2.ShowHint := false;
     2205        lblSHAD2.ShowHint := false;
    21292206        end;
    21302207 end;
     
    21402217    end;
    21412218 end;
    2142   {End BillingAware}
    2143 
    2144 end;
    2145 
    2146 procedure TfrmReview.fraCoPayLabel23Enter(Sender: TObject);
    2147 begin
    2148     (Sender as TORStaticText).Font.Style := [fsBold];
    2149 end;
    2150 
    2151 procedure TfrmReview.fraCoPayLabel23Exit(Sender: TObject);
    2152 begin
    2153     (Sender as TORStaticText).Font.Style := [];
    21542219end;
    21552220
     
    21812246
    21822247procedure TfrmReview.FormatListForScreenReader;
    2183 var
    2184   ListStateOn : longbool;
    2185   Success: longbool;
    2186 begin
    2187   //Determine if a screen reader is currently being used.
    2188   Success := SystemParametersInfo(SPI_GETSCREENREADER, 0, @ListStateOn,0);
    2189   if Success and ListStateOn then
     2248begin
     2249  if ScreenReaderActive then
    21902250    SetItemTextToState;
    21912251end;
Note: See TracChangeset for help on using the changeset viewer.