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

Upgrade to version 27

File:
1 edited

Legend:

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

    r456 r829  
    99  fAutoSz, StdCtrls, ORFn, ORCtrls, AppEvnts, mCoPayDesc, XUDIGSIGSC_TLB,
    1010  ComCtrls, CheckLst, ExtCtrls, uConsults, UBAGlobals,UBACore, UBAMessages, UBAConst,
    11   Menus, ORClasses;
     11  Menus, ORClasses, fBase508Form, fPrintLocation, VA508AccessibilityManager;
    1212
    1313type
    14   TfrmSignOrders = class(TForm)
     14  TfrmSignOrders = class(TfrmBase508Form)
    1515    cmdOK: TButton;
    1616    cmdCancel: TButton;
    1717    lblESCode: TLabel;
    1818    txtESCode: TCaptionEdit;
    19     fraCoPay: TfraCoPayDesc;
    2019    clstOrders: TCaptionCheckListBox;
    2120    laDiagnosis: TLabel;
     
    2726    Diagnosis1: TMenuItem;
    2827    Exit1: TMenuItem;
    29     Label2: TStaticText;
     28    lblOrderList: TStaticText;
     29    fraCoPay: TfraCoPayDesc;
    3030    procedure FormCreate(Sender: TObject);
    3131    procedure cmdOKClick(Sender: TObject);
     
    5454    procedure clstOrdersKeyUp(Sender: TObject; var Key: Word;
    5555      Shift: TShiftState);
     56    procedure FormResize(Sender: TObject);
    5657  private
    5758    OKPressed: Boolean;
     
    6263    function ItemsAreChecked: Boolean;
    6364    function GetNumberOfSelectedOrders : byte;
    64     procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TORStaticText); // 508
     65    procedure ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText); // 508
    6566    procedure SetItemTextToState;
    6667    procedure FormatListForScreenReader;
     
    7273
    7374{Begin BillingAware}
    74   { TODO 3 -oKW -cRefinement : Change to dynamic array or other dynamic structure for Billing Awareness Phase II. }
    75   TarRect = array[MIN_RECT..MAX_RECT] of TRect;
     75    TarRect = array[MIN_RECT..MAX_RECT] of TRect;
    7676
    7777  var
     
    105105    srcIndex: integer;
    106106    CopyBuffer: TBADxRecord;
    107     //CopyActive: boolean;  //CQ6225
    108107  {End BillingAware}
    109108
     
    114113uses
    115114  Hash, rCore, rOrders, uConst, fOrdersPrint, uCore, uOrders, uSignItems, fOrders,
    116   fPCELex, rPCE, fODConsult, fBALocalDiagnoses, fClinicWardMeds, fFrame;
     115  fPCELex, rPCE, fODConsult, fBALocalDiagnoses, fClinicWardMeds, fFrame, rODLab, fRptBox,
     116  VAUtils;
    117117
    118118const
     
    141141           on EListError do
    142142              begin
    143               {$ifdef debug}ShowMessage('EListError in frmSignOrders.GetNumberOfSelectedOrders()');{$endif}
     143              {$ifdef debug}Show508Message('EListError in frmSignOrders.GetNumberOfSelectedOrders()');{$endif}
    144144              raise;
    145145              end;
     
    174174  itemsList.Clear;
    175175  itemsList := uSigItems.GetSigItems; //Get FItems list
    176 
    177176  if BILLING_AWARE then
    178177     begin
     
    190189           on EListError do
    191190              begin
    192               {$ifdef debug}ShowMessage('EListError in frmSignOrders.GetCheckBoxStatus()');{$endif}
     191              {$ifdef debug}Show508Message('EListError in frmSignOrders.GetCheckBoxStatus()');{$endif}
    193192              raise;
    194193              end;
     
    198197
    199198function ExecuteSignOrders(SelectedList: TList): Boolean;
    200 var
    201   i, cidx,cnt, theSts: Integer;
     199const
     200  VERT_SPACING = 6;
     201
     202var
     203  i, cidx,cnt, theSts, WardIEN: Integer;
    202204  ShrinkHeight: integer;
    203205  SignList: TStringList;
    204206  Obj: TOrder;
    205   DigSigErr, DigStoreErr: Boolean;
     207  DigSigErr, DigStoreErr, ContainsIMOOrders, DoNotPrint: Boolean;
    206208  x, SigData, SigUser, SigDrugSch, SigDEA: string;
    207   cSignature, cHashData, cCrlUrl, cErr: string;
     209  cSignature, cHashData, cCrlUrl, cErr, WardName: string;
    208210  cProvDUZ: Int64;
    209   OrderText: string;
     211  OrderText, ASvc: string;
    210212  PrintLoc: Integer;
    211  // tempOrderID: string;
     213  AList, ClinicList, DCList, OrderPrintList, WardList: TStringList;
     214  EncLocName, EncLocText: string;
     215  EncLocIEN: integer;
     216  EncDT: TFMDateTime;
     217  EncVC: Char;
    212218
    213219  function FindOrderText(const AnID: string): string;
     
    253259  DigSigErr := True;
    254260  PrintLoc := 0;
     261  EncLocIEN := 0;
     262  DoNotPrint := False;
    255263  if SelectedList.Count = 0 then Exit;
    256264  if BILLING_AWARE then
     
    268276        cidx := frmSignOrders.clstOrders.Items.AddObject(Obj.Text,Obj);
    269277        SigItems.Add(CH_ORD,Obj.ID, cidx);
    270          //HDS6205 allows dx entry for NON CIDC Consult orders
    271    //    if BILLING_AWARE then  //HDS6205
    272    //        if UBAGlobals.BAConsultOrdersRequireDx.Count > 0 then  //HDS6205
    273    //        begin
    274   //            tempOrderID := UBACore.SetOrderIDConsultDxRequired(Piece(Obj.ID,';',1) + ';1');  //HDS6205
    275   //            tempOrderList.Add(tempOrderID);  //HDS6205
    276   //         end
    277   //         else
    278          if BILLING_AWARE then
    279             tempOrderList.Add(Obj.ID);
    280 
     278        if BILLING_AWARE then
     279           tempOrderList.Add(Obj.ID);
    281280        frmSignOrders.clstOrders.Checked[cidx] := TRUE;
    282281
     
    295294       {End BillingAware}
    296295
    297         ShrinkHeight := frmSignOrders.fraCoPay.Height + 9;
    298         frmSignOrders.Height := frmSignOrders.Height - ShrinkHeight;
    299         frmSignOrders.Label2.Top := frmSignOrders.Label2.Top - ShrinkHeight;
    300         frmSignOrders.clstOrders.Top := frmSignOrders.clstOrders.Top - ShrinkHeight;
    301         frmSignOrders.clstOrders.Height := frmSignOrders.clstOrders.Height + ShrinkHeight;
     296        with frmSignOrders do begin
     297          ShrinkHeight := lblOrderList.Top - VERT_SPACING;
     298          Height := Height - ShrinkHeight;
     299          lblOrderList.Top := lblOrderList.Top - ShrinkHeight;
     300          clstOrders.Top := clstOrders.Top - ShrinkHeight;
     301          clstOrders.Height := clstOrders.Height + ShrinkHeight;
     302        end;
    302303      end;
    303304
     
    329330    end;
    330331
    331      frmSignOrders.ShowModal;
     332      frmSignOrders.ShowModal;
    332333      if frmSignOrders.OKPressed then
    333334      begin
    334335        Result := True;
    335336        SignList := TStringList.Create;
     337        ClinicList := TStringList.Create;
     338        OrderPrintList := TStringList.Create;
     339        WardList := TStringList.Create;
     340        ContainsIMOOrders := false;
    336341        try
    337342          with SelectedList do for i := 0 to Count - 1 do with TOrder(Items[i]) do
     
    346351                  if Length(SigData) < 1 then
    347352                    begin
    348                       ShowMessage(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Digital Signature failed with reason: Unable to get required data from server');
     353                      ShowMsg(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Digital Signature failed with reason: Unable to get required data from server');
    349354                      DigStoreErr := true;
    350355                    end;
     
    368373                    else
    369374                      begin
    370                         ShowMessage(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Digital Signature failed with reason: '+ piece(Crypto.Reason, '^', 2));
     375                        ShowMsg(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Digital Signature failed with reason: '+ piece(Crypto.Reason, '^', 2));
    371376                        DigStoreErr := true;
    372377                      end;
     
    374379                    on  E: Exception do
    375380                      begin
    376                         ShowMessage(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Crypto raised an error: '+ E.Message);
     381                        ShowMsg(TOrder(SelectedList.Items[i]).Text + CRLF + CRLF + 'Crypto raised an error: '+ E.Message);
    377382                        DigStoreErr := true;
    378383                      end;
     
    399404                  if GetPKISite and (Copy(TOrder(SelectedList.Items[i]).DigSigReq,1,1) = '2') then
    400405                    begin
    401                       ShowMessage('ORDER NOT SENT TO PHARMACY' + CRLF + CRLF + TOrder(SelectedList.Items[i]).Text + CRLF + CRLF +
     406                      ShowMsg('ORDER NOT SENT TO PHARMACY' + CRLF + CRLF + TOrder(SelectedList.Items[i]).Text + CRLF + CRLF +
    402407                        'This Schedule II medication cannot be electronically entered without a Digital Signature. ' +
    403408                        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.');
     
    418423          if SignList.Count > 0 then
    419424          begin
    420 
    421           //hds7591  Clinic/Ward movement.  Patient Admission IMO
    422           if not frmFrame.TimedOut then
    423           begin
    424              if IsValidIMOLoc(uCore.TempEncounterLoc,Patient.DFN) then
    425                 frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,uCore.Encounter.LocationName, PrintLoc)
    426              else
    427                 if (IsValidIMOLoc(Encounter.Location,Patient.DFN)) and ((frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN)) and (Patient.Inpatient = false)) then
    428                    frmClinicWardMeds.ClinicOrWardLocation(SignList, Encounter.Location,Encounter.LocationName, PrintLoc);
    429           end;
    430           uCore.TempEncounterLoc := 0;
    431           uCore.TempEncounterLocName := '';
    432           //hds7591  Clinic/Ward movement  Patient Admission IMO
     425            //hds7591  Clinic/Ward movement.  Patient Admission IMO
     426            if not frmFrame.TimedOut then
     427            begin
     428               if (Patient.Inpatient = True) and (Encounter.Location <> Patient.Location) then
     429                   begin
     430                     DCList := TStringList.Create;
     431                     EncLocName := Encounter.LocationName;
     432                     EncLocIEN  := Encounter.Location;
     433                     EncLocText := Encounter.LocationText;
     434                     EncDT := Encounter.DateTime;
     435                     EncVC := Encounter.VisitCategory;
     436                     for i := 0 to SelectedList.Count - 1 do
     437                       begin
     438                         cidx := frmSignOrders.clstOrders.Items.IndexOfObject(TOrder(SelectedList.Items[i]));
     439                         if frmSignOrders.clstOrders.Checked[cidx] = false then continue;
     440                         if TOrder(SelectedList.Items[i]).DGroupName = 'Clinic Orders' then ContainsIMOOrders := true;
     441                         if TOrder(SelectedList.Items[i]).DGroupName = '' then continue;
     442                         if TOrder(SelectedList.Items[i]).EventPtr <> '' then continue;
     443                         if Pos('DC', TOrder(SelectedList.Items[i]).ActionOn) > 0 then
     444                           begin
     445                             DCList.Add(TOrder(SelectedList.Items[i]).ID);
     446                             Continue;
     447                           end;
     448                         OrderPrintList.Add(TOrder(SelectedList.Items[i]).ID + ':' + TOrder(SelectedList.Items[i]).Text);
     449                       end;
     450                      if OrderPrintList.Count > 0 then
     451                        begin
     452                          frmPrintLocation.PrintLocation(OrderPrintList, EncLocIEN, EncLocName, EncLocText, EncDT, EncVC, ClinicList,
     453                                                        WardList, WardIen,WardName, ContainsIMOOrders, true);
     454                          fframe.frmFrame.OrderPrintForm := false;
     455                        end
     456                      else DoNotPrint := True;
     457                      if (DCList <> nil) and (DCList.Count > 0) then
     458                        begin
     459                          for i := 0 to DCList.Count - 1 do
     460                             WardList.Add(DCList.Strings[i]);
     461                          if (WardIEN = 0) and (WardName = '') then
     462                          CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc);
     463                        end;
     464                      if DCList <> nil then DCList.Free;
     465                   end;
     466            end;
     467            uCore.TempEncounterLoc := 0;
     468            uCore.TempEncounterLocName := '';
     469            //hds7591  Clinic/Ward movement  Patient Admission IMO
    433470
    434471            SigItems.SaveSettings; // Save CoPay FIRST!
    435472            SendOrders(SignList, frmSignOrders.ESCode);
    436 
    437         end;
     473          end;
    438474
    439475            with SignList do if Count > 0 then for i := 0 to Count - 1 do
     
    442478                begin
    443479                  OrderText := FindOrderText(Piece(SignList[i], U, 1));
     480                  if Piece(SignList[i],U,4) = 'Invalid Pharmacy order number' then
     481                  InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText + CRLF + CRLF +
     482                        'The changes to this order have not been saved.  You must contact Pharmacy to complete any action on this order.',
     483                        TC_SAVERR, MB_OK)
     484                  else
    444485                  InfoBox(TX_SAVERR1 + Piece(SignList[i], U, 4) + TX_SAVERR2 + OrderText,
    445                           TC_SAVERR, MB_OK);
     486                        TC_SAVERR, MB_OK);
    446487                end;
    447488              if Pos('R', Piece(SignList[i], U, 2)) > 0 then
     
    459500              if theSts = 10 then  SignList.Delete(cnt);  //signed delayed order should not be printed.
    460501          end;
    461           PrintOrdersOnSignRelease(SignList, NO_PROVIDER, PrintLoc);
     502          //  CQ 10226, PSI-05-048 - advise of auto-change from LC to WC on lab orders
     503          AList := TStringList.Create;
     504          try
     505            CheckForChangeFromLCtoWCOnRelease(AList, Encounter.Location, SignList);
     506            if AList.Text <> '' then
     507              ReportBox(AList, 'Changed Orders', TRUE);
     508          finally
     509            AList.Free;
     510          end;
     511          if(ClinicList.Count > 0) or (WardList.count > 0) then
     512              PrintOrdersOnSignReleaseMult(SignList, CLinicList, WardList, NO_PROVIDER, EncLocIEN, WardIEN, EncLocName, wardName)
     513            else if DoNotPrint = False then PrintOrdersOnSignRelease(SignList, NO_PROVIDER, PrintLoc);
    462514        finally
    463515          SignList.Free;
     516          OrderPrintList.free;
     517          WardList.free;
     518          ClinicList.free;
    464519        end;
    465520      end; {if frmSignOrders.OKPressed}
     
    486541  if  BILLING_AWARE then
    487542      begin
    488         clstOrders.Height := 234;
     543        clstOrders.Height := 228;
    489544        clstOrders.Top :=  (gbdxLookup.top + 65);
    490545        gbDxLookup.Visible := TRUE;
    491         label2.Top := (gbdxLookup.Top +  48);
    492         laDiagnosis.Top :=  Label2.Top;
     546        lblOrderList.Top := (gbdxLookup.Top +  gbdxLookup.Height);
     547        laDiagnosis.Top :=  lblOrderList.Top;
    493548        laDiagnosis.Left := 270;
    494549        laDiagnosis.Visible := TRUE;
     
    497552   else
    498553      begin
    499          label2.Top := 145;
    500          label2.Left := 8;
     554         lblOrderList.Top := 158;
     555         lblOrderList.Left := 8;
    501556     end;
    502557 {End BillingAware}
     
    609664       begin
    610665          Canvas.FillRect(ARect);
    611           Canvas.Pen.Color := clSilver;
     666          Canvas.Pen.Color := Get508CompliantColor(clSilver);
    612667          Canvas.MoveTo(ARect.Left, ARect.Bottom);
    613668          Canvas.LineTo(ARect.Right, ARect.Bottom);
     
    619674          //Adjust position of 'Diagnosis' column label for font size
    620675          laDiagnosis.Left := ARect.Right + 14;
    621 
    622               //ARect.Right below controls the right-hand side of the Dx Column
    623               //Adjust ARect.Right in conjunction with procedure uSignItems.TSigItems.lbDrawItem(), because the
    624               //two rectangles overlap each other.
     676          if uSignItems.GetAllBtnLeftPos > 0 then
     677             laDiagnosis.left := uSignItems.GetAllBtnLeftPos - (laDiagnosis.Width +5);
     678              // ARect.Right below controls the right-hand side of the Dx Column
     679              // Adjust ARect.Right in conjunction with procedure uSignItems.TSigItems.lbDrawItem(), because the
     680              // two rectangles overlap each other.
    625681           if  BILLING_AWARE then
    626682           begin
     
    631687              //Win32 API - This call to DrawText draws the text of the ORDER - not the diagnosis code
    632688               DrawText(Canvas.handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    633        {v25 BA}
    634         if  BILLING_AWARE then
     689       if  BILLING_AWARE then
    635690         begin
    636691             if Assigned(UBAGlobals.tempDxList) then
    637692                begin
    638                 tempID := TOrder(clstOrders.Items.Objects[Index]).ID;
     693                   tempID := TOrder(clstOrders.Items.Objects[Index]).ID;
    639694
    640695                if UBAGlobals.tempDxNodeExists(tempID) then
     
    646701                       str := Piece(str,':',1);
    647702                       DrawText(Canvas.handle, PChar(str), Length(str), arRect[Index], DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    648                        if Not UBACore.IsOrderBillable(tempID) then //and
    649                       //    Not UBAGlobals.tempDxNodeExists(tempID) then   // if consult is non cidc but requires dx, show it.
     703                       if Not UBACore.IsOrderBillable(tempID) then
    650704                       begin
    651705                            Canvas.Font.Color := clBlue;
     
    676730             if Index < Items.Count then
    677731                begin
    678                 Canvas.FillRect(ARect);
    679                 Canvas.Pen.Color := clSilver;
    680                 Canvas.MoveTo(ARect.Left, ARect.Bottom - 1);
    681                 Canvas.LineTo(ARect.Right, ARect.Bottom - 1);
    682                 X := FilteredString(Items[Index]);
    683                 DrawText(Canvas.handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
     732                  Canvas.FillRect(ARect);
     733                  Canvas.Pen.Color := Get508CompliantColor(clSilver);
     734                  Canvas.MoveTo(ARect.Left, ARect.Bottom - 1);
     735                  Canvas.LineTo(ARect.Right, ARect.Bottom - 1);
     736                  X := FilteredString(Items[Index]);
     737                  DrawText(Canvas.handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
    684738                end;
    685739           end;
     
    761815        if Checked[i] then
    762816           begin
    763            Result := True;
    764            break;
     817             Result := True;
     818             break;
    765819           end;
    766820end;
     
    795849                      for i := 0 to (tempDxList.Count - 1) do
    796850                         begin
    797                           thisRec := TBADxRecord(tempDxList.Items[i]);
     851                           thisRec := TBADxRecord(tempDxList.Items[i]);
    798852
    799853                          if Assigned(thisRec) then
     
    815869                    on EListError do
    816870                       begin
    817                        {$ifdef debug}ShowMessage('EListError in frmSignOrders.clstOrdersMouseMove()');{$endif}
     871                       {$ifdef debug}Show508Message('EListError in frmSignOrders.clstOrdersMouseMove()');{$endif}
    818872                       raise;
    819873                       end;
     
    841895{Begin BillingAware}
    842896
     897  if (clstOrders.Top + clstOrders.Height) > (lblESCode.Top - 4) then
     898      clstOrders.Height := lblESCode.Top - clstOrders.Top - 4;
     899
    843900  //INITIALIZATIONS
    844901  Paste1.Enabled := false;
     
    859916         with fraCoPay do
    860917           begin
    861             Label24.Caption := 'Service &Connected Condition';
    862             StaticText4.Caption := 'Combat &Vet (Combat Related)';
    863             Label18.Caption := 'Agent &Orange Exposure';
    864             Label16.Caption := 'Ionizing &Radiation Exposure';
    865             Label14.Caption := '&Environmental Contaminants';
    866             Label12.Caption := '&MST';
     918            lblSC2.Caption := 'Service &Connected Condition';
     919            lblCV2.Caption := 'Combat &Vet (Combat Related)';
     920            lblAO2.Caption := 'Agent &Orange Exposure';
     921            lblIR2.Caption := 'Ionizing &Radiation Exposure';
     922            lblSWAC2.Caption := '&Environmental Contaminants';
     923            lblMST2.Caption := '&MST';
    867924            lblHNC2.Caption := '&Head and/or Neck Cancer';
    868             Label24.ShowAccelChar := true;
    869             StaticText4.ShowAccelChar := true;
    870             Label18.ShowAccelChar := true;
    871             Label16.ShowAccelChar := true;
    872             Label14.ShowAccelChar := true;
    873             Label12.ShowAccelChar := true;
     925            lblSHAD2.Caption := 'Shi&pboard Hazard and Defense';
     926            lblSC2.ShowAccelChar := true;
     927            lblCV2.ShowAccelChar := true;
     928            lblAO2.ShowAccelChar := true;
     929            lblIR2.ShowAccelChar := true;
     930            lblSWAC2.ShowAccelChar := true;
     931            lblMST2.ShowAccelChar := true;
    874932            lblHNC2.ShowAccelChar := true;
     933            lblSHAD2.ShowAccelChar := true;
    875934           end;
    876935        end;  //BILLING_AWARE
     
    916975  match := false;
    917976  allBlank := false;
    918   //orderIDList := TStringList.Create;
    919977  if Assigned (orderIDList) then orderIDList.Clear;
    920978  if Assigned(UBAGlobals.PLFactorsIndexes) then UBAGlobals.PLFactorsIndexes.Clear;
     
    9521010                 {$ifdef debug}
    9531011                 with UBAGlobals.globalDxRec do
    954                     //ShowMessage('globalDxRec:'+#13+FOrderID+#13+FBADxCode+#13+FBASecDx1+#13+FBASecDx2+#13+FBASecDx3);
     1012                    //Show508Message('globalDxRec:'+#13+FOrderID+#13+FBADxCode+#13+FBASecDx1+#13+FBASecDx2+#13+FBASecDx3);
    9551013                 {$endif}
    9561014                  end;
     
    9591017     except
    9601018        on E: Exception  do
    961            ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
     1019           ShowMsg(E.ClassName+' error raised, with message : '+E.Message);
    9621020   end;
    9631021
     
    9661024  if numSelected = 0 then
    9671025     begin
    968      ShowMessage(UBAMessages.BA_NO_ORDERS_SELECTED);
     1026     ShowMsg(UBAMessages.BA_NO_ORDERS_SELECTED);
    9691027     Exit;
    9701028     end
     
    9811039
    9821040  if ((match and allBlank) or (match and (not allBlank))) then  // All selected are blank or matching-not-blank
    983 //     begin
    984      { TODO 3 -oKW -cRefinement : Define a const to replace string literal }
    985        frmBALocalDiagnoses.Enter(UBAConst.F_ORDERS_SIGN, orderIDList)
     1041        frmBALocalDiagnoses.Enter(UBAConst.F_ORDERS_SIGN, orderIDList)
    9861042   else
    9871043     begin
     
    9921048              Exit
    9931049         else
    994 //              begin
    9951050              if Assigned(UBAGlobals.globalDxRec) then
    9961051                 InitializeNewDxRec(UBAGlobals.globalDxRec);
     
    10301085         if numSelected > 1 then
    10311086           begin
    1032            ShowMessage('Only 1 order at a time may be selected for ''Copying''');
     1087           ShowMsg('Only 1 order at a time may be selected for ''Copying''');
    10331088           Exit;
    10341089           end;
     
    10581113               //*************************************************************************
    10591114               if (NOT UBACore.IsOrderBillable(fOrdersSign.srcOrderID) ) then //and
    1060              //    (NOT tempDxNodeExists(fOrdersSign.srcOrderID)) then   // added to allow copy to NON CIDC consult order the requires a DX. then
     1115               // added to allow copy to NON CIDC consult order the requires a DX. then
    10611116                 begin
    1062                  ShowMessage(BA_NA_COPY_DISALLOWED);
    1063                  fOrdersSign.srcOrderID := '';
    1064                  Exit;
     1117                   ShowMsg(BA_NA_COPY_DISALLOWED);
     1118                   fOrdersSign.srcOrderID := '';
     1119                   Exit;
    10651120                 end;
    10661121               //*************************************************************************
     
    10741129     on EListError do
    10751130        begin
    1076         ShowMessage('EListError in frmSignOrders.Copy1Click()');
     1131          ShowMsg('EListError in frmSignOrders.Copy1Click()');
    10771132        raise;
    10781133        end;
    10791134   end;
    1080 
    1081   //CopyActive := true; //CQ6225
    1082   //Paste1.Enabled := true; //CQ6225
    10831135end;
    10841136
     
    11011153               if (fOrdersSign.frmSignOrders.clstOrders.Selected[i]) then
    11021154                 begin
    1103                  fOrdersSign.targetOrderID := TChangeItem(fOrdersSign.frmSignOrders.clstOrders.Items.Objects[i]).ID;
     1155                   fOrdersSign.targetOrderID := TChangeItem(fOrdersSign.frmSignOrders.clstOrders.Items.Objects[i]).ID;
    11041156
    11051157                  if fOrdersSign.targetOrderID = fOrdersSign.srcOrderID then //disallow copying an order to itself
     
    11121164                     if Not UBACore.IsOrderBillable(targetOrderID) then
    11131165                       begin
    1114                        ShowMessage(BA_NA_PASTE_DISALLOWED);
    1115                        fOrdersSign.targetOrderID := '';
    1116                        Continue;
     1166                         ShowMsg(BA_NA_PASTE_DISALLOWED);
     1167                         fOrdersSign.targetOrderID := '';
     1168                         Continue;
    11171169                       end;
    11181170                     //***************************************************************
     
    11211173                     with newRec do
    11221174                       begin
    1123                        FOrderID :=  fOrdersSign.targetOrderID;
    1124                        FBADxCode := CopyBuffer.FBADxCode;
    1125                        FBASecDx1 := CopyBuffer.FBASecDx1;
    1126                        FBASecDx2 := CopyBuffer.FBASecDx2;
    1127                        FBASecDx3 := CopyBuffer.FBASecDx3;
     1175                         FOrderID :=  fOrdersSign.targetOrderID;
     1176                         FBADxCode := CopyBuffer.FBADxCode;
     1177                         FBASecDx1 := CopyBuffer.FBASecDx1;
     1178                         FBASecDx2 := CopyBuffer.FBASecDx2;
     1179                         FBASecDx3 := CopyBuffer.FBASecDx3;
    11281180                       end;
    11291181
     
    11381190        on EListError do
    11391191           begin
    1140            ShowMessage('EListError in frmSignOrders.Paste1Click()'+#13+'for i := 0 to clstOrders.Count - 1 do');
     1192             ShowMsg('EListError in frmSignOrders.Paste1Click()'+#13+'for i := 0 to clstOrders.Count - 1 do');
    11411193           raise;
    11421194           end;
     
    11441196         clstOrders.Refresh; //Update grid to show pasted Dx
    11451197     end;
    1146 {
    1147   //CQ6225
    1148   if CopyActive then
    1149      begin
    1150      Paste1.Enabled := false;
    1151      CopyActive := false;
    1152      end;
    1153   //end CQ6225
    1154 }
    11551198end;
    11561199
     
    11731216           if fOrdersSign.frmSignOrders.clstOrders.Items.Count = 1 then
    11741217              begin
    1175               Copy1.Enabled := false;
    1176               Paste1.Enabled := false
     1218                Copy1.Enabled := false;
     1219                Paste1.Enabled := false
    11771220              end
    11781221           else
    11791222              begin
    1180               Copy1.Enabled := true;
    1181               //Paste1.Enabled := true; //commented out for CQ6225
     1223                Copy1.Enabled := true;
    11821224              end;
    11831225           //End CQ3325
     
    11941236        on EListError do
    11951237           begin
    1196            ShowMessage('EListError in frmSignOrders.clstOrdersMouseDown()');
     1238             ShowMsg('EListError in frmSignOrders.clstOrdersMouseDown()');
    11971239           raise;
    11981240           end;
     
    12251267           if clstOrders.Selected[i] then
    12261268              begin
    1227               thisChangeItem := TChangeItem(clstOrders.Items.Objects[i]);
    1228 
    1229               //Disallow copying of a grid HEADER item on LEFT MOUSE CLICK
     1269                thisChangeItem := TChangeItem(clstOrders.Items.Objects[i]);
     1270
     1271                //Disallow copying of a grid HEADER item on LEFT MOUSE CLICK
    12301272              if thisChangeItem = nil then
    12311273                 begin
    1232                  Copy1.Enabled := false;
    1233                  buOrdersDiagnosis.Enabled := false;
    1234                  Exit;
     1274                   Copy1.Enabled := false;
     1275                   buOrdersDiagnosis.Enabled := false;
     1276                   Exit;
    12351277                 end;
    12361278
    12371279              if (thisChangeItem <> nil) then //Blank row - not an order item
    12381280                 begin
    1239                  thisOrderList.Clear;
    1240                  thisOrderList.Add(thisChangeItem.ID);
    1241 
    1242                  if IsAllOrdersNA(thisOrderList) then
    1243                  begin
    1244                     Diagnosis1.Enabled := false;
    1245                     buOrdersDiagnosis.Enabled := false;
    1246                  end
     1281                   thisOrderList.Clear;
     1282                   thisOrderList.Add(thisChangeItem.ID);
     1283
     1284                   if IsAllOrdersNA(thisOrderList) then
     1285                   begin
     1286                     Diagnosis1.Enabled := false;
     1287                     buOrdersDiagnosis.Enabled := false;
     1288                  end
    12471289                 else
    12481290                 begin
     
    12681310  j: integer; //CQ5054
    12691311begin
    1270 
    1271        if FOSTFHintWndActive then
    1272        begin
    1273           FOSTFhintWindow.ReleaseHandle ;
    1274           FOSTFHintWndActive := False ;
    1275        end;
    1276 
    1277        case Key of
    1278            67,99:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSC,fraCoPay.Label24); //C,c
    1279            86,118: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorCV,fraCoPay.staticText4); //V,v
    1280            79,111: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorAO,fraCoPay.Label18); //O,o
    1281            82,114: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorIR,fraCoPay.Label16); //R,r
    1282            69,101: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorEC,fraCoPay.Label14); //E,e
    1283            77,109: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorMST,fraCoPay.Label12); //M,m
    1284            72,104: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorHNC,fraCoPay.lblHNC2); //H,h
    1285            //CQ5054
    1286            83,115: if (ssAlt in Shift) then
    1287                 begin
    1288                 for j := 0 to clstOrders.Items.Count-1 do
    1289                       clstOrders.Selected[j] := false;
    1290                 clstOrders.Selected[0] := true;
    1291                 clstOrders.SetFocus;
    1292                 end;
    1293            //end CQ5054
    1294        end;
     1312  inherited;
     1313  if FOSTFHintWndActive then
     1314  begin
     1315    FOSTFhintWindow.ReleaseHandle ;
     1316    FOSTFHintWndActive := False ;
     1317  end;
     1318
     1319  case Key of
     1320     67,99:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSC,fraCoPay.lblSC2); //C,c
     1321     86,118: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorCV,fraCoPay.lblCV2); //V,v
     1322     79,111: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorAO,fraCoPay.lblAO2); //O,o
     1323     82,114: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorIR,fraCoPay.lblIR2); //R,r
     1324     65,97:  if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorEC,fraCoPay.lblSWAC2); //A,a
     1325     77,109: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorMST,fraCoPay.lblMST2); //M,m
     1326     78,110: if (ssAlt in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorHNC,fraCoPay.lblHNC2); //N,n
     1327     72,104: if (ssALT in Shift) then ShowTreatmentFactorHints(BAFactorsRec.FBAFactorSHAD,fraCopay.lblSHAD2); // H,h
     1328     //CQ5054
     1329     83,115: if (ssAlt in Shift) then
     1330          begin
     1331            for j := 0 to clstOrders.Items.Count-1 do
     1332                clstOrders.Selected[j] := false;
     1333            clstOrders.Selected[0] := true;
     1334            clstOrders.SetFocus;
     1335          end;
     1336     //end CQ5054
     1337  end;
    12951338end;
    12961339
    12971340//BILLING AWARE Procedure
    1298 procedure TfrmSignOrders.ShowTreatmentFactorHints(var pHintText: string; var pCompName: TORStaticText); // 508
     1341procedure TfrmSignOrders.ShowTreatmentFactorHints(var pHintText: string; var pCompName: TVA508StaticText); // 508
    12991342var
    13001343 HRect: TRect;
     
    13061349     if FOSTFhintWndActive then
    13071350        begin
    1308         FOSTFhintWindow.ReleaseHandle;
    1309         FOSTFhintWndActive := False;
     1351          FOSTFhintWindow.ReleaseHandle;
     1352          FOSTFhintWndActive := False;
    13101353        end;
    13111354  except
    13121355     on E: Exception do
    13131356        begin
    1314         {$ifdef debug}ShowMessage('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
     1357        {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
    13151358        raise;
    13161359        end;
     
    13291372      hrect.Bottom := hrect.Bottom + Y;
    13301373
    1331   if FOSTFHintWndActive then
    1332      begin
    1333      with fraCoPay do
    1334         begin
    1335         //Abbreviated captions
    1336         Label23.ShowHint := false;
    1337         StaticText1.ShowHint := false;
    1338         Label17.ShowHint := false;
    1339         Label15.ShowHint := false;
    1340         Label13.ShowHint := false;
    1341         Label11.ShowHint := false;
    1342         lblHNC.ShowHint := false;
    1343         //Long captions
    1344         staticText4.ShowHint := false;
    1345         Label17.ShowHint := false;
    1346         Label18.ShowHint := false;
    1347         Label15.ShowHint := false;
    1348         Label16.ShowHint := false;
    1349         Label13.ShowHint := false;
    1350         Label14.ShowHint := false;
    1351         Label11.ShowHint := false;
    1352         Label12.ShowHint := false;
    1353         lblHNC.ShowHint := false;
    1354         lblHNC2.ShowHint := false;
    1355         end;
    1356      end
    1357   else
    1358      begin
    1359      with fraCoPay do
    1360         begin
    1361         //Abbreviated captions
    1362         Label23.ShowHint := true;
    1363         StaticText1.ShowHint := true;
    1364         Label17.ShowHint := true;
    1365         Label15.ShowHint := true;
    1366         Label13.ShowHint := true;
    1367         Label11.ShowHint := true;
    1368         lblHNC.ShowHint := true;
    1369         //Long captions       
    1370         staticText4.ShowHint := true;
    1371         Label17.ShowHint := true;
    1372         Label18.ShowHint := true;
    1373         Label15.ShowHint := true;
    1374         Label16.ShowHint := true;
    1375         Label13.ShowHint := true;
    1376         Label14.ShowHint := true;
    1377         Label11.ShowHint := true;
    1378         Label12.ShowHint := true;
    1379         lblHNC.ShowHint := true;
    1380         lblHNC2.ShowHint := true;
    1381         end;
    1382      end;
     1374      fraCoPay.LabelCaptionsOn(not FOSTFHintWndActive);
    13831375
    13841376      FOSTFhintWindow.ActivateHint(hrect, pHintText);
     
    13871379     on E: Exception do
    13881380        begin
    1389         {$ifdef debug}ShowMessage('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
     1381        {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmSignOrders.ShowTreatmentFactorHints()');{$endif}
    13901382        raise;
    13911383        end;
     
    14051397     on E: Exception do
    14061398        begin
    1407         {$ifdef debug}ShowMessage('Unhandled exception in procedure TfrmSignOrders.FormMouseMove()');{$endif}
     1399        {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmSignOrders.FormMouseMove()');{$endif}
    14081400        raise;
    14091401        end;
     
    14111403end;
    14121404
     1405procedure TfrmSignOrders.FormResize(Sender: TObject);
     1406begin
     1407  inherited;
     1408  clstOrders.invalidate;
     1409end;
     1410
    14131411procedure TfrmSignOrders.fraCoPaylblHNCMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    14141412begin
    1415   if FOSTFHintWndActive then
    1416      begin
    1417      with fraCoPay do
    1418         begin
    1419         //Abbreviated captions
    1420         Label23.ShowHint := false;
    1421         StaticText1.ShowHint := false;
    1422         Label17.ShowHint := false;
    1423         Label15.ShowHint := false;
    1424         Label13.ShowHint := false;
    1425         Label11.ShowHint := false;
    1426         lblHNC.ShowHint := false;
    1427         //Long captions
    1428         Label24.ShowHint := false;
    1429         staticText4.ShowHint := false;
    1430         Label17.ShowHint := false;
    1431         Label18.ShowHint := false;
    1432         Label15.ShowHint := false;
    1433         Label16.ShowHint := false;
    1434         Label13.ShowHint := false;
    1435         Label14.ShowHint := false;
    1436         Label11.ShowHint := false;
    1437         Label12.ShowHint := false;
    1438         lblHNC.ShowHint := false;
    1439         lblHNC2.ShowHint := false;
    1440         end;
    1441      end
    1442   else
    1443      begin
    1444      with fraCoPay do
    1445         begin
    1446         //Abbreviated captions
    1447         Label23.ShowHint := true;
    1448         StaticText1.ShowHint := true;
    1449         Label17.ShowHint := true;
    1450         Label15.ShowHint := true;
    1451         Label13.ShowHint := true;
    1452         Label11.ShowHint := true;
    1453         lblHNC.ShowHint := true;
    1454         //Long captions
    1455         Label24.ShowHint := true;
    1456         staticText4.ShowHint := true;
    1457         Label17.ShowHint := true;
    1458         Label18.ShowHint := true;
    1459         Label15.ShowHint := true;
    1460         Label16.ShowHint := true;
    1461         Label13.ShowHint := true;
    1462         Label14.ShowHint := true;
    1463         Label11.ShowHint := true;
    1464         Label12.ShowHint := true;
    1465         lblHNC.ShowHint := true;
    1466         lblHNC2.ShowHint := true;
    1467         end;
    1468      end;
    1469 
     1413  fraCoPay.LabelCaptionsOn(not FOSTFHintWndActive)
    14701414end;
    14711415
    14721416procedure TfrmSignOrders.fraCoPayLabel23Enter(Sender: TObject);
    14731417begin
    1474     (Sender as TORStaticText).Font.Style := [fsBold];
     1418    (Sender as TVA508StaticText).Font.Style := [fsBold];
    14751419end;
    14761420
    14771421procedure TfrmSignOrders.fraCoPayLabel23Exit(Sender: TObject);
    14781422begin
    1479     (Sender as TORStaticText).Font.Style := [];
     1423    (Sender as TVA508StaticText).Font.Style := [];
    14801424end;
    14811425
     
    15121456
    15131457procedure TfrmSignOrders.FormatListForScreenReader;
    1514 var
    1515   ListStateOn : longbool;
    1516   Success: longbool;
    1517 begin
    1518   //Determine if a screen reader is currently being used.
    1519   Success := SystemParametersInfo(SPI_GETSCREENREADER, 0, @ListStateOn,0);
    1520   if Success and ListStateOn then
     1458begin
     1459  if ScreenReaderActive then
    15211460    SetItemTextToState;
    15221461end;
Note: See TracChangeset for help on using the changeset viewer.