Procedure

TfrmReview.BuildList

Module

fReview

Last Modified

7/15/2014 3:26:38 PM

Visibility

Private

Owner

TfrmReview

Declaration

procedure BuildList(FullList: boolean);

Calls Hierarchy


TfrmReview.BuildList
 ├TSigItems.ResetOrders
 ├TfrmReview.AddHeader
 ├TfrmReview.AddItem
 ├rpcBuildSCIEList
 ├CompleteUnsignedBillingInfo
 │ ├InitializeUnsignedOrderRec
 │ ├LoadUnsignedOrderRec
 │ ├tempDxNodeExists
 │ ├SimpleAddTempDxList
 │ │ └TfrmBALocalDiagnoses.LoadTempRec
 │ │   ├TfrmFrame.GetTimedOut
 │ │   │ └TimedOut
 │ │   ├InitializeNewDxRec
 │ │   └StripTFactors
 │ ├PutBADxListForOrder
 │ ├GetBADxListForOrder
 │ └BuildSaveUnsignedList
 │   └SaveBillingData
 │     ├AttachDxToOrderList
 │     │ ├InitializeNewDxRec
 │     │ └GetBADxListForOrder
 │     └rpcSaveCIDCData
 │       └VerifyOrderIdExists
 ├rpcGetUnsignedOrdersBillingData
 ├IsPendingHold
 ├TSigItems.Add
 ├GetPKISite
 ├GetPKIUse
 ├DEACheckFailedAtSignature
 ├GetOrderableIen
 ├TfrmReview.AddCSHeader
 ├TfrmReview.AddCSItem
 ├TChanges.CanSign
 ├TfrmReview.SignRequiredForAny
 │ └AnyOrdersRequireSignature
 ├TfrmReview.ItemsAreChecked
 ├TfrmReview.AnyItemsAreChecked
 │ ├TfrmReview.ItemsAreChecked
 │ └TfrmReview.CSItemsAreChecked
 ├TfrmReview.txtESCodeChange
 │ └TfrmReview.AnyItemsAreChecked...
 ├GetUserParam
 ├TfrmReview.radReleaseClick
 ├TfrmReview.AdjustSignatureTop
 ├TSigItems.ClearDrawItems
 ├TSigItems.ClearFcb
 ├TSigItems.UpdateListBox
 │ ├notRightOne
 │ ├IsOrderBillable
 │ │ └PrepOrderID
 │ ├RemoveOrderFromDxList
 │ │ └tempDxNodeExists
 │ ├rpcGetSC4Orders
 │ ├OrderRequiresSCEI
 │ ├GetUnsignedOrderFlags
 │ ├GetConsultFlags
 │ │ └SetConsultFlags
 │ ├TSigItems.cbClicked
 │ │ └TSigItems.TagToItem
 │ ├SigItemHeight
 │ ├TSigItems.lbDrawItem
 │ │ └TSigItems.TagToItem
 │ ├CreateCB
 │ │ ├TSigItems.cbClicked...
 │ │ ├TSigItems.cbEnter
 │ │ └TSigItems.cbExit
 │ ├TSigItems.ItemToTag
 │ ├TSigItems.TagInfo
 │ └TSigItems.TagToItem
 └TfrmReview.lstReviewMeasureItem
   └SigItemHeight

Called-By Hierarchy


                                            TfrmReview.BuildList
                                      TfrmReview.BuildFullList┤ 
                                               ReviewChanges┘ │ 
                           TfrmFrame.AllowContextChangeAll┤   │ 
                                TfrmFrame.FormCloseQuery┤ │   │ 
                              TfrmFrame.mnuFileNextClick┤ │   │ 
                            TfrmFrame.mnuFileOpenClick┤ │ │   │ 
                                TfrmFrame.UMInitiate┤ │ │ │   │ 
                       TfrmFrame.mnuFileNextClick...┤ │ │ │   │ 
                       TfrmFrame.mnuFileRefreshClick┤ │ │ │   │ 
                       TfrmOrders.CheckOrderStatus┤ │ │ │ │   │ 
                   TfrmOrders.mnuActChgEvntClick┤ │ │ │ │ │   │ 
                      TfrmOrders.mnuActHoldClick┤ │ │ │ │ │   │ 
                    TfrmOrders.mnuActUnholdClick┤ │ │ │ │ │   │ 
                     TfrmOrders.mnuActRenewClick┤ │ │ │ │ │   │ 
                    TfrmOrders.mnuActChangeClick┤ │ │ │ │ │   │ 
                      TfrmOrders.mnuActCopyClick┘ │ │ │ │ │   │ 
                            TfrmMeds.mnuActDCClick┤ │ │ │ │   │ 
                           TfrmMeds.CheckMedStatus┘ │ │ │ │   │ 
                        TfrmMeds.mnuActHoldClick┤   │ │ │ │   │ 
                       TfrmMeds.mnuActRenewClick┤   │ │ │ │   │ 
                      TfrmMeds.mnuActUnholdClick┤   │ │ │ │   │ 
                      TfrmMeds.mnuActChangeClick┤   │ │ │ │   │ 
                        TfrmMeds.mnuActCopyClick┤   │ │ │ │   │ 
                      TfrmMeds.mnuActRefillClick┘   │ │ │ │   │ 
                                  TfrmFrame.ViewInfo┘ │ │ │   │ 
                               TfrmDCSumm.ViewInfo┤   │ │ │   │ 
                             TfrmConsults.ViewInfo┤   │ │ │   │ 
                     TfrmFrame.pnlRemindersMouseUp┤   │ │ │   │ 
                      TfrmFrame.RemindersChanged┘ │   │ │ │   │ 
                          TfrmFrame.FormCreate┘   │   │ │ │   │ 
                            TfrmFrame.pnlCIRNClick┤   │ │ │   │ 
                      TfrmFrame.pnlVistaWebClick┤ │   │ │ │   │ 
                           TfrmFrame.FormKeyDown┘ │   │ │ │   │ 
                         TfrmFrame.pnlPatientClick┤   │ │ │   │ 
                           TfrmFrame.pnlVisitClick┤   │ │ │   │ 
                     TfrmFrame.pnlPrimaryCareClick┤   │ │ │   │ 
                       TfrmFrame.pnlRemindersClick┤   │ │ │   │ 
                        TfrmFrame.pnlPostingsClick┤   │ │ │   │ 
                            TfrmFrame.pnlFlagClick┤   │ │ │   │ 
                              TfrmFrame.laMHVClick┤   │ │ │   │ 
                             TfrmFrame.laVAA2Click┤   │ │ │   │ 
                               TfrmOrders.ViewInfo┤   │ │ │   │ 
                                 TfrmMeds.ViewInfo┤   │ │ │   │ 
                              TfrmSurgery.ViewInfo┤   │ │ │   │ 
                                TfrmNotes.ViewInfo┤   │ │ │   │ 
                             TfrmProblems.ViewInfo┘   │ │ │   │ 
                     TfrmFrame.mnuFileNotifRemoveClick┤ │ │   │ 
                             TfrmFrame.NextButtonClick┘ │ │   │ 
                           TfrmFrame.SetUpNextButton┘   │ │   │ 
                     TfrmFrame.mnuFileOpenClick...┤     │ │   │ 
                              TfrmFrame.FormResize┘     │ │   │ 
                            TfrmFrame.ChangeFont┘       │ │   │ 
                    TfrmFrame.LoadSizesForUser┤         │ │   │ 
               TfrmFrame.LoadUserPreferences┘ │         │ │   │ 
                      TfrmFrame.UMInitiate┘   │         │ │   │ 
                    TfrmFrame.mnuFontSizeClick┘         │ │   │ 
                           TfrmFrame.mnuFileOpenClick...┤ │   │ 
                           TfrmFrame.ctxContextorPending┤ │   │ 
                          TfrmFrame.StartCCOWContextor┘ │ │   │ 
                                TfrmFrame.FormCreate┘   │ │   │ 
                         TfrmFrame.ctxContextorCommitted┤ │   │ 
                       TfrmFrame.StartCCOWContextor...┘ │ │   │ 
                  TfrmFrame.mnuFileResumeContextGetClick┤ │   │ 
                  TfrmFrame.mnuFileResumeContextSetClick┘ │   │ 
                                  TfrmFrame.FormCloseQuery┤   │ 
                              TfrmFrame.mnuFileReviewClick┤   │ 
                                           UpdateEncounter┘   │ 
                         TfrmFrame.mnuFileEncounterClick┤     │ 
                                 TfrmFrame.ViewInfo...┤ │     │ 
                    TfrmODMedIV.SetValuesFromResponses┤ │     │ 
                             TfrmODMedIV.SetupDialog┤ │ │     │ 
                   TfrmODMedIV.cboSolutionMouseClick┘ │ │     │ 
                       TfrmODMedIV.cboSolutionExit┘   │ │     │ 
                  TfrmODMedIV.cboSolutionMouseClick...┤ │     │ 
                     TfrmODMedIV.cboAdditiveMouseClick┤ │     │ 
                         TfrmODMedIV.cboAdditiveExit┘ │ │     │ 
                                TfrmODAuto.SetupDialog┤ │     │ 
                                   ActivateOrderDialog┤ │     │ 
                           TfrmRemDlg.btnFinishClick┤ │ │     │ 
           TfrmConsults.mnuActNewConsultRequestClick┤ │ │     │ 
                   TfrmConsults.cmdNewConsultClick┘ │ │ │     │ 
                TfrmConsults.mnuActNewProcedureClick┤ │ │     │ 
                      TfrmConsults.cmdNewProcClick┘ │ │ │     │ 
                                        ChangeOrders┤ │ │     │ 
                      TfrmOrders.mnuActChangeClick┤ │ │ │     │ 
                        TfrmMeds.mnuActChangeClick┘ │ │ │     │ 
                                     ChangeOrdersEvt┤ │ │     │ 
                                          CopyOrders┤ │ │     │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │     │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │     │ 
                           TfrmODActive.btnOKClick┘ │ │ │     │ 
                                      TransferOrders┤ │ │     │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │     │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │     │ 
                           TfrmODActive.btnOKClick┘ │ │ │     │ 
                            TfrmOrders.lstWriteClick┤ │ │     │ 
               TfrmOrders.PlaceOrderForDefaultDialog┤ │ │     │ 
                  TfrmOrders.DisplayDefaultDlgList┤ │ │ │     │ 
                       TfrmOrders.ResetOrderPage┘ │ │ │ │     │ 
               TfrmOrders.btnDelayedOrderClick┘   │ │ │ │     │ 
                                 DisplayEvntDialog┤ │ │ │     │ 
                             SetDelayEventForMed┘ │ │ │ │     │ 
                      TfrmMeds.mnuActCopyClick┘   │ │ │ │     │ 
                                 DisplayEvntDialog┤ │ │ │     │ 
                                  SetViewForCopy┘ │ │ │ │     │ 
                    TfrmOrders.mnuActCopyClick┘   │ │ │ │     │ 
                                 DisplayEvntDialog┘ │ │ │     │ 
                                ExecuteChangeEvt┘   │ │ │     │ 
                 TfrmOrders.mnuActChgEvntClick┘     │ │ │     │ 
                             TfrmMeds.mnuActNewClick┤ │ │     │ 
                           TfrmOMNavA.ActivateDialog┤ │ │     │ 
                         TfrmOMNavA.grdMenuKeyDown┤ │ │ │     │ 
                         TfrmOMNavA.grdMenuMouseUp┘ │ │ │     │ 
                                TfrmOMSet.DoNextItem┘ │ │     │ 
                              TfrmOMSet.InsertList┤   │ │     │ 
                               ActivateOrderList┘ │   │ │     │ 
                     TfrmRemDlg.btnFinishClick┤   │   │ │     │ 
                             ActivateOrderHTML┤   │   │ │     │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │     │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │   │ │     │ 
                              ActivateOrderSet┤   │   │ │     │ 
                   TfrmRemDlg.btnFinishClick┤ │   │   │ │     │ 
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │   │ │     │ 
     TfrmConsults.mnuActNewProcedureClick...┤ │   │   │ │     │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │     │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │   │ │     │ 
                     TfrmMeds.mnuActNewClick┤ │   │   │ │     │ 
                TfrmOMNavA.ActivateDialog...┤ │   │   │ │     │ 
                     TfrmOMSet.DoNextItem...┘ │   │   │ │     │ 
                       TfrmOMNavA.DoSelectList┘   │   │ │     │ 
                     TfrmOMNavA.grdMenuKeyUp┤     │   │ │     │ 
                   TfrmOMNavA.grdMenuMouseUp┘     │   │ │     │ 
                                        SkipToNext┤   │ │     │ 
                         TfrmOMSet.DoNextItem...┘ │   │ │     │ 
                            TfrmOMSet.UMDelayEvent┘   │ │     │ 
                               TfrmOMSet.InsertList...┤ │     │ 
                                TfrmODMeds.SetupDialog┤ │     │ 
                             TfrmODMeds.btnSelectClick┤ │     │ 
                             TfrmODMeds.UMDelayClick┘ │ │     │ 
                                    ExecuteRenewOrders┘ │     │ 
                         TfrmOrders.mnuActRenewClick┤   │     │ 
                           TfrmMeds.mnuActRenewClick┘   │     │ 
                                        EncounterPresent┤     │ 
                                      ReadyForNewOrder┤ │     │ 
                           TfrmRemDlg.btnFinishClick┤ │ │     │ 
        TfrmConsults.mnuActNewConsultRequestClick...┤ │ │     │ 
             TfrmConsults.mnuActNewProcedureClick...┤ │ │     │ 
                                     ChangeOrders...┤ │ │     │ 
                                     ChangeOrdersEvt┤ │ │     │ 
                                       CopyOrders...┤ │ │     │ 
                                   TransferOrders...┤ │ │     │ 
                            TfrmOrders.lstWriteClick┤ │ │     │ 
                             TfrmMeds.mnuActNewClick┘ │ │     │ 
                                     ReadyForNewOrder1┤ │     │ 
            TfrmOrders.PlaceOrderForDefaultDialog...┘ │ │     │ 
                              TfrmOrders.mnuActDCClick┤ │     │ 
                             TfrmOrders.mnuActRelClick┤ │     │ 
                            TfrmOrders.mnuActHoldClick┤ │     │ 
                          TfrmOrders.mnuActUnholdClick┤ │     │ 
                           TfrmOrders.mnuActRenewClick┤ │     │ 
                         TfrmOrders.mnuActReleaseClick┤ │     │ 
                         TfrmOrders.mnuActOnChartClick┤ │     │ 
                            TfrmOrders.mnuActSignClick┤ │     │ 
                                TfrmMeds.mnuActDCClick┤ │     │ 
                              TfrmMeds.mnuActHoldClick┤ │     │ 
                             TfrmMeds.mnuActRenewClick┤ │     │ 
                            TfrmMeds.mnuActUnholdClick┤ │     │ 
                              TfrmMeds.mnuActCopyClick┤ │     │ 
                            TfrmMeds.mnuActRefillClick┘ │     │ 
                                     EncounterPresentEDO┤     │ 
                                   ReadyForNewOrder...┤ │     │ 
                         TfrmOrders.mnuActChgEvntClick┤ │     │ 
                          TfrmOrders.mnuActChangeClick┤ │     │ 
                            TfrmOrders.mnuActCopyClick┤ │     │ 
                       TfrmOrders.btnDelayedOrderClick┤ │     │ 
                            TfrmMeds.mnuActChangeClick┤ │     │ 
                              TfrmMeds.mnuActCopyClick┘ │     │ 
                                             UpdateVisit┤     │ 
                                           EditPCEData┤ │     │ 
                             TfrmSurgery.cmdPCEClick┤ │ │     │ 
                                 UpdateEncounterInfo┘ │ │     │ 
                             TfrmNotes.cmdPCEClick┘   │ │     │ 
                        TfrmVitals.btnEnterVitalsClick┘ │     │ 
                                             UpdateVisit┤     │ 
                                        EncounterPresent┘     │ 
                         TfrmProblems.lstProbActsClick┘       │ 
                     TfrmProblems.wgProbDataDblClick┤         │ 
                           TfrmProblems.lstViewClick┘         │ 
                   TfrmProblems.HighlightDuplicate┘           │ 
                         TfrmProblems.AddProblem┤             │ 
              TfrmProblems.lstProbActsClick...┤ │             │ 
                 TfrmProblems.lstProbPickClick┤ │             │ 
              TfrmProblems.lstProbPickDblClick┤ │             │ 
              TfrmProblems.edProbEntKeyPress┘ │ │             │ 
                      TfrmProblems.UMPLLexicon┘ │             │ 
                   TfrmdlgProb.bbChangeProbClick┘             │ 
                                      TfrmReview.BuildSignList┘ 
                                            ReviewChanges...┘   

Calls

Name Declaration Comments
TSigItems.Add procedure Add(ItemType: Integer; const ID: string; Index: integer); -
TfrmReview.AddCSHeader procedure AddCSHeader(s: string); -
TfrmReview.AddCSItem function AddCSItem(ChangeItem: TChangeItem): integer; -
TfrmReview.AddHeader procedure AddHeader(s: string); -
TfrmReview.AddItem function AddItem(ChangeItem: TChangeItem): integer; -
TfrmReview.AdjustSignatureTop procedure AdjustSignatureTop( HeightAdjustment: integer); -
TfrmReview.AnyItemsAreChecked function AnyItemsAreChecked: Boolean; -
TChanges.CanSign function CanSign: Boolean; -
TSigItems.ClearDrawItems procedure ClearDrawItems; -
TSigItems.ClearFcb procedure ClearFcb; -
CompleteUnsignedBillingInfo procedure CompleteUnsignedBillingInfo(pOrderList: TStringList); -
DEACheckFailedAtSignature function DEACheckFailedAtSignature(AnOI: Integer; ForInpatient: Boolean): string; -
GetOrderableIen function GetOrderableIen(AnOrderId:string): integer; -
GetPKISite function GetPKISite: Boolean; -
GetPKIUse function GetPKIUse: Boolean; -
GetUserParam function GetUserParam(const AParamName: string): string; -
IsPendingHold function IsPendingHold(OrderID: string): boolean; -
TfrmReview.ItemsAreChecked function ItemsAreChecked: Boolean; -
TfrmReview.lstReviewMeasureItem procedure lstReviewMeasureItem(Control: TWinControl; Index: Integer; var AHeight: Integer); -
TfrmReview.radReleaseClick procedure radReleaseClick(Sender: TObject); -
TSigItems.ResetOrders procedure ResetOrders; -
rpcBuildSCIEList procedure rpcBuildSCIEList(pOrderList: TList); -
rpcGetUnsignedOrdersBillingData function rpcGetUnsignedOrdersBillingData(pOrderList: TStringList):TStringList; -
TfrmReview.SignRequiredForAny function SignRequiredForAny(FullList: boolean): Boolean; -
TfrmReview.txtESCodeChange procedure txtESCodeChange(Sender: TObject); -
TSigItems.UpdateListBox function UpdateListBox(lb: TCustomListBox): boolean; -

Called-By

Name Declaration Comments
TfrmReview.BuildFullList procedure BuildFullList; -
TfrmReview.BuildSignList procedure BuildSignList; -


Source

505   procedure TfrmReview.BuildList(FullList: boolean);
506   var
507     GrpIndex, ChgIndex, lbIdx: Integer;
508     ChangeItem: TChangeItem;
509     LabelHeight: integer;
510     PrevGrpName, temp: string;
511     displayHeader, displaySpacer, displayCSHeader, displayCSSpacer, otherUserOrders, otherhdradded, othercshdradded: boolean;
512     I, ColHeight: Integer;
513     t1, t2{, NVAinNonCSList, otherinNonCSList}: Boolean;
514   begin
515     tempOrderList := TStringList.Create;
516     tempOrderList.Clear;
517     PrevGrpName := '';
518   //  NVAinNonCSList := false;
519   //  otherinNonCSList := false;
520     lstReview.Clear;  // ok to clear without freeing objects since they're part of Changes
521     if(FullList) then
522     begin
523       SigItems.ResetOrders;
524       SigItemsCS.ResetOrders;
525       with Changes do
526       if PCE.Count > 0 then
527       begin
528         for GrpIndex := 0 to PCEGrp.Count - 1 do
529         begin
530           AddHeader('Outpatient Encounter ' + PCEGrp[GrpIndex]);
531           for ChgIndex := 0 to PCE.Count - 1 do
532           begin
533             ChangeItem := PCE[ChgIndex];
534             if ChangeItem.GroupName = PCEGrp[GrpIndex] then AddItem(ChangeItem);
535           end;
536           AddHeader('   ');
537         end;
538       end; {if PCE}
539     end;
540     with Changes do
541     if Documents.Count > 0 then
542     begin
543       AddHeader('Documents');
544       for ChgIndex := 0 to Documents.Count - 1 do
545       begin
546         ChangeItem := Documents[ChgIndex];
547         if(FullList or (ChangeItem.SignState <> CH_SIGN_NA)) then
548            AddItem(ChangeItem);
549       end;
550       if(FullList) then
551          AddHeader('   ');
552     end; {if Documents}
553     if(FullList) then
554     begin
555       //otherUserOrders := False;
556       displaySpacer := False;
557       displayCSSpacer := False;
558       with Changes do
559       if Orders.Count > 0 then
560       begin
561         OrderGrp.Sorted := True;
562         otherUserOrders := False;
563         for GrpIndex := 0 to OrderGrp.Count - 1 do
564         begin
565           displayHeader := True;
566           displayCSHeader := True;
567           if (GrpIndex > 0 ) and (AnsiCompareText(PrevGrpName,OrderGrp[GrpIndex])=0) then
568             Continue;
569           if OrderGrp[GrpIndex] = '' then Temp := 'My Unsigned Orders - This Session'
570           else if OrderGrp[GrpIndex] = 'Other Unsigned' then Temp := 'My Unsigned Orders - Previous Sessions'
571           else Temp := 'Orders - ' + OrderGrp[GrpIndex];
572           {billing aware}
573           if BILLING_AWARE then
574           begin
575              UBACore.rpcBuildSCIEList(Orders);            // build list of orders and Billable Status
576              UBACore.CompleteUnsignedBillingInfo(rpcGetUnsignedOrdersBillingData(OrderListSCEI) );
577           end;
578           {billing aware}
579   
580           for ChgIndex := 0 to Orders.Count - 1 do
581           begin
582             ChangeItem := Orders[ChgIndex];
583             if (ChangeItem.GroupName = OrderGrp[GrpIndex]) and ((ChangeItem.User = 0) or (ChangeItem.User = User.DUZ)) then
584             begin
585               if ((ChangeItem.CSValue = False) or ChangeItem.DCOrder or IsPendingHold(ChangeItem.ID)) then
586               begin
587                 if displayHeader = True then
588                   begin
589                    AddHeader(Temp);
590                     displayHeader := False;
591                    displaySpacer := True;
592                  end;
593                 lbIdx := AddItem(ChangeItem);
594                 SigItems.Add(CH_ORD, ChangeItem.ID, lbIdx);
595   //              if (ChangeItem.OrderDG = 'Non-VA Meds') or (Pos('Non-VA',ChangeItem.Text)>0) then NVAinNonCSList := true
596   //              else otherinNonCSList := true;
597               end
598               else
599               begin
600                 if not(GetPKISite) or not(GetPKIUse) or (DEACheckFailedAtSignature(GetOrderableIen(Piece(ChangeItem.ID,';',1)),False)='1') then ChangeItem.SignState := CH_SIGN_NA;
601   
602                 if displayCSHeader = True then
603                   begin
604                    AddCSHeader(Temp);
605                     displayCSHeader := False;
606                    displayCSSpacer := True;
607                  end;
608                 lbIdx := AddCSItem(ChangeItem);
609                 SigItemsCS.Add(CH_ORD, ChangeItem.ID, lbIdx);
610               end;
611               
612            end
613            else if ((ChangeItem.User > 0) and (ChangeItem.User <> User.DUZ)) then
614              otherUserOrders := True;
615           end;
616           if displayHeader = False then AddHeader('   ');
617           if displayCSHeader = False then AddCSHeader('   ');
618           PrevGrpName := OrderGrp[GrpIndex];
619       end;
620       //AGP fix for CQ 10073
621       if otherUserOrders = True then
622             begin
623               othercshdradded := false;
624               otherhdradded := false;
625               for ChgIndex := 0 to Orders.Count - 1 do
626                begin
627                   ChangeItem := Orders[ChgIndex];
628                   if (ChangeItem.GroupName = 'Other Unsigned') and ((ChangeItem.User >0) and (ChangeItem.User <> User.DUZ)) then
629                     begin
630   
631                       if ((ChangeItem.CSValue = False) or ChangeItem.DCOrder or IsPendingHold(ChangeItem.ID)) then
632                       begin
633                         if not otherhdradded then
634                         begin
635                           otherhdradded := true;
636                           if displaySpacer = True then AddHeader('   ');
637                           AddHeader('Others'' Unsigned Orders Orders - All Sessions');
638                         end;         
639                         lbIdx := AddItem(ChangeItem);
640                         SigItems.Add(CH_ORD, ChangeItem.ID, lbIdx);
641   //                      if (ChangeItem.OrderDG = 'Non-VA Meds') or (Pos('Non-VA',ChangeItem.Text)>0) then NVAinNonCSList := true
642   //                      else otherinNonCSList := true;
643                       end
644                       else
645                       begin
646                         if not(GetPKIUse) or not(GetPKISite) or (DEACheckFailedAtSignature(GetOrderableIen(Piece(ChangeItem.ID,';',1)),False)='1') then ChangeItem.SignState := CH_SIGN_NA;
647                         if not othercshdradded then
648                         begin
649                           othercshdradded := true;
650                           if displayCSSpacer = True then AddCSHeader('   ');
651                           AddCSHeader('Others'' Unsigned Orders - All Sessions');
652                         end;
653                         lbIdx := AddCSItem(ChangeItem);
654                         SigItemsCS.Add(CH_ORD, ChangeItem.ID, lbIdx);
655                       end;
656                     end;
657               end;
658           end;
659       OrderGrp.Sorted := false;
660     end; {if Orders}
661       // determine the appropriate panel to display
662       case User.OrderRole of
663           OR_CLERK: FShowPanel := SP_CLERK;
664           OR_NURSE: FShowPanel := SP_NURSE;
665       OR_PHYSICIAN: FShowPanel := SP_SIGN;
666         OR_STUDENT: if Changes.CanSign then FShowPanel := SP_SIGN else FShowPanel := SP_NONE;
667       else          FShowPanel := SP_NONE;
668       end; {case User}
669     end
670     else
671       FShowPanel := SP_SIGN;
672   
673     case FShowPanel of
674     SP_CLERK: begin
675                 pnlSignature.Visible := False;
676                 pnlOrderAction.Visible := SignRequiredForAny(FullList);
677               end;
678     SP_NURSE: begin
679                 pnlSignature.Visible := False;
680                 radRelease.Visible := True;
681                 grpRelease.Visible := True;
682                 pnlOrderAction.Visible := SignRequiredForAny(FullList);
683               end;
684      SP_SIGN: begin
685                 pnlOrderAction.Visible := False;
686                 pnlSignature.Visible := ItemsAreChecked;
687               end;
688     else      begin                                // SP_NONE
689                 pnlOrderAction.Visible := False;
690                 pnlSignature.Visible := False;
691               end;
692     end; {case FShowPanel}
693     pnlSignature.Visible := AnyItemsAreChecked;
694     
695   
696     txtESCodeChange(Self);
697     if pnlOrderAction.Visible then
698     begin
699   //    lblSig.Caption := 'Documents / Orders';
700       if FShowPanel = SP_NURSE then
701       begin
702         if GetUserParam('OR SIGNATURE DEFAULT ACTION') = 'OC'
703           then radHoldSign.Checked  := True
704           else radRelease.Checked   := True;
705       end;
706       if (radHoldSign.Checked) and (GetUserParam('OR SIGNED ON CHART') = '1')
707         then radSignChart.Checked := True;
708       if radRelease.Checked then radReleaseClick(Self);
709     end {if pnlOrderAction}
710     else
711     begin
712   //    if (User.OrderRole = OR_STUDENT) or (User.OrderRole = OR_NOKEY) or (User.OrderRole = OR_BADKEYS) then
713   //    begin
714   //      if otherinNonCSList then lblSig.Caption := 'These Non-Controlled Substance orders will be held until signed. '
715   //      else lblSig.Caption := ' ';
716   //      if NVAinNonCSList then lblSig.Caption := lblSig.Caption + 'Non-VA documentation will become active.';
717   //
718   //      lblCSReview.Caption := 'These Controlled Substance orders will be held until signed';
719   //    end
720   //    else
721   //    begin
722   //      lblSig.Caption := 'All Orders Except Controlled Substance EPCS Orders';
723   //    end;
724   
725     end;
726     //Make sure there is enough width for the buttons and lblSig
727      //begin BillingAware
728     if  BILLING_AWARE then
729     begin
730        LabelHeight := lstReview.Top - fraCoPay.Height;
731        AdjustSignatureTop( ResizeHeight( BaseFont, MainFont, LabelHeight) - LabelHeight);
732     end;
733      //end BillingAware
734   
735   
736       if frmReview.lstCSReview.Count>0 then
737       begin
738         if not(GetPKISite) then
739         begin
740           ShowMsg('Digital Signing of Controlled Substances is currently disabled for your site. Controlled Substance Orders will not be signed.');
741   //          frmReview.lstCSReview.Clear;
742   //          SigItemsCS.ResetOrders;
743         end
744         else if not(GetPKIUse ) then
745         begin
746           ShowMsg('You are not currently permitted to digitally sign Controlled Substances. Controlled Substance Orders will not be signed.');
747   //          frmReview.lstCSReview.Clear;
748   //          SigItemsCS.ResetOrders;
749         end;
750       end;
751   
752   
753      SigItems.ClearDrawItems;
754      SigItems.ClearFcb;
755      SigItemsCS.ClearDrawItems;
756      SigItemsCS.ClearFcb;
757      t1 := SigItems.UpdateListBox(lstReview);
758      t2 := SigItemsCS.UpdateListBox(lstCSReview);
759   
760     if (FullList and (t1 or t2)) then
761     begin
762       fraCoPay.Visible := TRUE;
763       if  BILLING_AWARE then frmReview.gbxDxLookup.Visible := TRUE;
764     end
765     else
766     begin
767       fraCoPay.Visible := FALSE;
768       if  BILLING_AWARE then frmReview.gbxDxLookup.Visible := FALSE;
769     end;
770   
771     if lstReview.Count > 0 then begin
772      for I := 1 to lstReview.Count - 1 do begin
773       lstReviewMeasureItem(lstReview, I, ColHeight);
774       lstReview.Perform(LB_SETITEMHEIGHT,I,ColHeight);
775      end;
776     end;
777     RedrawWindow(lstReview.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN);
778     if frmReview.pnlSignature.Visible and frmReview.txtESCode.Visible then  frmReview.ActiveControl := frmReview.txtESCode;
779   end; {BuildFullList}