Procedure

TfrmReports.LoadListView

Module

fReports

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmReports

Declaration

procedure LoadListView(aReportData: TStringList);

Calls Hierarchy


TfrmReports.LoadListView
 ├TRowObject.Add
 │ ├TCellObject.Create
 │ └TCellObject.Add
 └TUser.HasKey
   └HasSecurityKey

Called-By Hierarchy


                               TfrmReports.LoadListView
                        TfrmReports.lstQualifierClick┤ 
                         TfrmReports.tvReportsClick┘ │ 
                  TfrmFrame.lstCIRNLocationsClick┤   │ 
                            TfrmFrame.SetUpCIRN┘ │   │ 
                       TfrmFrame.SetupPatient┘   │   │ 
                  UpdatePatientInfoForAlert┤     │   │ 
               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.AllowCCOWContextChange┤     │   │ 
            TfrmFrame.mnuFileNextClick...┤ │     │   │ 
            TfrmFrame.mnuFileOpenClick...┤ │     │   │ 
   TfrmFrame.mnuFileResumeContextSetClick┘ │     │   │ 
                TfrmFrame.UpdateCCOWContext┤     │   │ 
            TfrmFrame.mnuFileOpenClick...┤ │     │   │ 
          TfrmFrame.ctxContextorCommitted┤ │     │   │ 
           TfrmFrame.StartCCOWContextor┘ │ │     │   │ 
                 TfrmFrame.FormCreate┘   │ │     │   │ 
   TfrmFrame.mnuFileResumeContextGetClick┘ │     │   │ 
     TfrmFrame.mnuFileResumeContextSetClick┘     │   │ 
                          TfrmReports.DisplayPage┤   │ 
                         TfrmReports.LoadTreeView┤   │ 
                        TfrmReports.DisplayPage┤ │   │ 
           TfrmOptionsReportsDefault.btnOKClick┤ │   │ 
        TfrmOptionsReportsDefault.btnResetClick┤ │   │ 
         TfrmOptionsReportsCustom.btnApplyClick┘ │   │ 
          TfrmOptionsReportsCustom.btnOKClick┘   │   │ 
                 TfrmReports.ProcessNotifications┤   │ 
                        TfrmReports.DisplayPage┘ │   │ 
                     TfrmReports.tvReportsKeyDown┤   │ 
                  TfrmReports.tvProceduresKeyDown┤   │ 
                      TfrmReports.chkMaxFreqClick┤   │ 
             TfrmOptionsReportsDefault.btnOKClick┤   │ 
          TfrmOptionsReportsDefault.btnResetClick┤   │ 
        TfrmOptionsReportsCustom.btnApplyClick...┘   │ 
                              TfrmReports.Timer1Timer┤ 
                                 TfrmReports.GoRemote┤ 
                   TfrmReports.lstQualifierClick...┤ │ 
                      TfrmReports.tvReportsClick...┘ │ 
                        TfrmReports.tvReportsClick...┘ 

Calls

Name Declaration Comments
TRowObject.Add procedure Add(ASite, AHandle, AColumnData: string; AData: TStringList); -
TUser.HasKey function HasKey(const KeyName: string): Boolean; -

Called-By

Name Declaration Comments
TfrmReports.GoRemote procedure GoRemote(Dest: TStringList; AItem: string; AQualifier, ARpc: string; AHSTag: string; AHDR: string; aFHIE: string); -
TfrmReports.lstQualifierClick procedure lstQualifierClick(Sender: TObject); -
TfrmReports.Timer1Timer procedure Timer1Timer(Sender: TObject); -
TfrmReports.tvReportsClick procedure tvReportsClick(Sender: TObject); -


Source

743   procedure TfrmReports.LoadListView(aReportData: TStringList);
744   var
745     i,j,k,aErr: integer;
746     aTmpAray: TStringList;
747     aColCtr, aCurCol, aCurRow, aColID: integer;
748     x,y,z,c,aSite: string;
749     ListItem: TListItem;
750   begin
751     aSite := '';
752     aErr := 0;
753     ListItem := nil;
754     case uQualifierType of
755       QT_HSCOMPONENT:
756         begin      //      = 5
757           if (length(piece(uHState,';',2)) > 0) then //and (chkText.Checked = false) then
758             begin
759               with lvReports do
760                 begin
761                   ViewStyle := vsReport;
762                   for j := 0 to aReportData.Count - 1 do
763                     begin
764                       if piece(aReportData[j],'^',1) = '-1' then  //error condition, most likely remote call
765                         continue;
766                       ListItem := Items.Add;
767                       aSite := piece(aReportData[j],'^',1);
768                       ListItem.Caption := piece(aSite,';',1);
769                       for k := 2 to uColumns.Count do
770                         begin
771                           ListItem.SubItems.Add(piece(aReportData[j],'^',k));
772                         end;
773                     end;
774                   if aReportData.Count = 0 then
775                     begin
776                       uReportInstruction := '<No Data Available>';
777                       memText.Lines.Clear;
778                       memText.Lines.Add(uReportInstruction);
779                     end
780                   else
781                     memText.Lines.Clear;
782                 end;
783             end;
784         end;
785       QT_HSWPCOMPONENT:
786         begin     //      = 6
787           if (length(piece(uHState,';',2)) > 0) then //and (chkText.Checked = false) then
788             begin
789               aTmpAray := TStringList.Create;
790               aCurRow := 0;
791               aCurCol := 0;
792               aColCtr := 9;
793               aTmpAray.Clear;
794               with lvReports do
795                 begin
796                   for j := 0 to aReportData.Count - 1 do
797                     begin
798                       x := aReportData[j];
799                       aColID := StrToIntDef(piece(x,'^',1),-1);
800                       if aColID < 0 then    //this is an error condition most likely an incompatible remote call
801                         continue;
802                       if aColID > (uColumns.Count - 1) then
803                         begin
804                           aErr := 1;
805                           continue;           //extract is out of sync with columns defined in 101.24
806                         end;
807                       if aColID < aColCtr then
808                         begin
809                           if aTmpAray.Count > 0 then
810                             begin
811                               if aColCtr = 1 then
812                                 begin
813                                   ListItem := Items.Add;
814                                   aSite := piece(aTmpAray[j],'^',1);
815                                   ListItem.Caption := piece(aSite,';',1);
816                                   ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
817                                 end
818                               else
819                                 begin
820                                   c := aTmpAray[0];
821                                   if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
822                                     c := c + '...';
823                                   z := piece(c,'^',1);
824                                   y := copy(c, (pos('^', c)), 9999);
825                                   if pos('^',y) > 0 then
826                                     begin
827                                       while pos('^',y) > 0 do
828                                         begin
829                                           y := copy(y, (pos('^', y)+1), 9999);
830                                           z := z + '^' + y;
831                                         end;
832                                           ListItem.SubItems.Add(z);
833                                     end
834                                   else
835                                     begin
836                                       ListItem.SubItems.Add(y);
837                                     end;
838                                 end;
839                               RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
840                               aTmpAray.Clear;
841                             end;
842                           aColCtr := 0;
843                           aCurCol := aColID;
844                           aCurRow := aCurRow + 1;
845                         end
846                       else
847                         if aColID = aCurCol then
848                           begin
849                             z := '';
850                             y := piece(x,'^',2);
851                             if length(y) > 0 then z := y;
852                             y := copy(x, (pos('^', x)+1), 9999);
853                             if pos('^',y) > 0 then
854                               begin
855                                 while pos('^',y) > 0 do
856                                   begin
857                                     y := copy(y, (pos('^', y)+1), 9999);
858                                     z := z + '^' + y;
859                                   end;
860                                 aTmpAray.Add(z);
861                               end
862                             else
863                               begin
864                                 aTmpAray.Add(y);
865                               end;
866                             continue;
867                           end;
868                       if aTmpAray.Count > 0 then
869                         begin
870                           if aColCtr = 1 then
871                             begin
872                               ListItem := Items.Add;
873                               aSite := piece(aTmpAray[0],'^',1);
874                               ListItem.Caption := piece(aSite,';',1);
875                               ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
876                             end
877                           else
878                             begin
879                               c := aTmpAray[0];
880                               if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
881                                 c := c + '...';
882                               ListItem.SubItems.Add(c);
883                             end;
884                           RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
885                           aTmpAray.Clear;
886                         end;
887                       aCurCol := aColID;
888                       Inc(aColCtr);
889                       y := '';
890                       for k := 2 to 10 do
891                         if length(piece(x,'^',k)) > 0 then
892                           begin
893                             if length(y) > 0 then y := y + '^' + piece(x,'^',k)
894                             else y := y + piece(x,'^',k);
895                           end;
896                       aTmpAray.Add(y);
897                       if aColCtr > 0 then
898                         while aColCtr < aCurCol do
899                           begin
900                             ListItem.SubItems.Add('');
901                             Inc(aColCtr);
902                           end;
903                     end;
904                   if aTmpAray.Count > 0 then
905                     begin
906                       if aColCtr = 1 then
907                         begin
908                           ListItem := Items.Add;
909                           aSite := piece(aTmpAray[0],'^',1);
910                           ListItem.Caption := piece(aSite,';',1);
911                           ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
912                         end
913                       else
914                         begin
915                           c := aTmpAray[0];
916                           if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
917                             c := c + '...';
918                           ListItem.SubItems.Add(c);
919                         end;
920                       RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
921                       aTmpAray.Clear;
922                     end;
923                 end;
924               aTmpAray.Free;
925             end;
926           if uRptID = 'OR_R18:IMAGING' then with lvReports do  //set image indicator for "Imaging" report
927             begin
928               SmallImages := dmodShared.imgImages;
929               imgLblImages.ComponentImageListChanged;
930               for i := 0 to Items.Count - 1 do
931                 if (Items[i].SubItems.Count > 7) and (Items[i].SubItems[7] = 'Y') then
932                   Items[i].SubItemImages[1] := IMG_1_IMAGE
933                 else
934                   Items[i].SubItemImages[1] := IMG_NO_IMAGES;
935             end
936           else //lvReports.SmallImages := uEmptyImageList;
937           if uRptID = 'OR_PN:PROGRESS NOTES' then with lvReports do  //set image indicator for "Progress Notes" report
938             begin
939               SmallImages := dmodShared.imgImages;
940               imgLblImages.ComponentImageListChanged;
941               for i := 0 to Items.Count - 1 do
942                 if (Items[i].SubItems.Count > 7) and (StrToInt(Items[i].SubItems[7]) > 0) then
943                   Items[i].SubItemImages[2] := IMG_1_IMAGE
944                 else
945                   Items[i].SubItemImages[2] := IMG_NO_IMAGES;
946             end
947           else begin
948             lvReports.SmallImages := uEmptyImageList;
949             imgLblImages.ComponentImageListChanged;
950           end;
951         end;
952     end;
953     if aErr = 1 then
954       if User.HasKey('XUPROGMODE') then
955         ShowMsg('Programmer message: One or more Column ID''s in file 101.24 do not match ID''s coded in extract routine');
956   end;