Procedure

TfrmLabs.LoadListView

Module

fLabs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmLabs

Declaration

procedure LoadListView(aReportData: TStringList);

Calls Hierarchy


TfrmLabs.LoadListView
 ├TLabRowObject.Add
 │ ├TCellObject.Create
 │ └TCellObject.Add
 └TUser.HasKey
   └HasSecurityKey

Called-By Hierarchy


                                  TfrmLabs.LoadListView
                           TfrmLabs.lstQualifierClick┤ 
                            TfrmLabs.tvReportsClick┘ │ 
                             TfrmLabs.DisplayPage┤   │ 
                            TfrmLabs.LoadTreeView┤   │ 
                           TfrmLabs.DisplayPage┤ │   │ 
         TfrmOptionsReportsCustom.btnApplyClick┘ │   │ 
          TfrmOptionsReportsCustom.btnOKClick┘   │   │ 
                      TfrmLabs.cmdOtherTestsClick┤   │ 
                         TfrmLabs.chkMaxFreqClick┤   │ 
                    TfrmLabs.ProcessNotifications┤   │ 
                           TfrmLabs.DisplayPage┘ │   │ 
                                        ..(rec)..┤   │ 
                        TfrmLabs.tvReportsKeyDown┤   │ 
                  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┘         │ 
                                 TfrmLabs.Timer1Timer┤ 
                           TfrmLabs.tvReportsClick...┤ 
                                    TfrmLabs.GoRemote┘ 
                      TfrmLabs.lstQualifierClick...┤   
                         TfrmLabs.tvReportsClick...┘   

Calls

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

Called-By

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


Source

663   procedure TfrmLabs.LoadListView(aReportData: TStringList);
664   var
665     j,k,aErr: integer;
666     aTmpAray: TStringList;
667     aColCtr, aCurCol, aCurRow, aColID: integer;
668     x,y,z,c,aSite: string;
669     ListItem: TListItem;
670   begin
671     aSite := '';
672     aErr := 0;
673     ListItem := nil;
674     case uQualifierType of
675       QT_HSCOMPONENT:
676         begin      //      = 5
677           if (length(piece(uHState,';',2)) > 0) then
678             begin
679               with lvReports do
680                 begin
681                   ViewStyle := vsReport;
682                   for j := 0 to aReportData.Count - 1 do
683                     begin
684                       if piece(aReportData[j],'^',1) = '-1' then  //error condition, most likely remote call
685                         continue;
686                       ListItem := Items.Add;
687                       aSite := piece(aReportData[j],'^',1);
688                       ListItem.Caption := piece(aSite,';',1);
689                       for k := 2 to uColumns.Count do
690                         begin
691                           ListItem.SubItems.Add(piece(aReportData[j],'^',k));
692                         end;
693                     end;
694                   if aReportData.Count = 0 then
695                     begin
696                       uReportInstruction := '<No Data Available>';
697                       memLab.Lines.Clear;
698                       memLab.Lines.Add(uReportInstruction);
699                     end
700                   else
701                     memLab.Lines.Clear;
702                 end;
703             end;
704         end;
705       QT_HSWPCOMPONENT:
706         begin     //      = 6
707           if (length(piece(uHState,';',2)) > 0) then //and (chkText.Checked = false) then
708             begin
709               aTmpAray := TStringList.Create;
710               aCurRow := 0;
711               aCurCol := 0;
712               aColCtr := 9;
713               aTmpAray.Clear;
714               with lvReports do
715                 begin
716                   for j := 0 to aReportData.Count - 1 do
717                     begin
718                       x := aReportData[j];
719                       aColID := StrToIntDef(piece(x,'^',1),-1);
720                       if aColID < 0 then    //this is an error condition most likely an incompatible remote call
721                         continue;
722                       if aColID > (uColumns.Count - 1) then
723                         begin
724                           aErr := 1;
725                           continue;           //extract is out of sync with columns defined in 101.24
726                         end;
727                       if aColID < aColCtr then
728                         begin
729                           if aTmpAray.Count > 0 then
730                             begin
731                               if aColCtr = 1 then
732                                 begin
733                                   ListItem := Items.Add;
734                                   aSite := piece(aTmpAray[j],'^',1);
735                                   ListItem.Caption := piece(aSite,';',1);
736                                   ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
737                                 end
738                               else
739                                 begin
740                                   c := aTmpAray[0];
741                                   if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
742                                     c := c + '...';
743                                   z := piece(c,'^',1);
744                                   y := copy(c, (pos('^', c)), 9999);
745                                   if pos('^',y) > 0 then
746                                     begin
747                                       while pos('^',y) > 0 do
748                                         begin
749                                           y := copy(y, (pos('^', y)+1), 9999);
750                                           z := z + '^' + y;
751                                         end;
752                                           ListItem.SubItems.Add(z);
753                                     end
754                                   else
755                                     begin
756                                       ListItem.SubItems.Add(y);
757                                     end;
758                                 end;
759                               LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
760                               aTmpAray.Clear;
761                             end;
762                           aColCtr := 0;
763                           aCurCol := aColID;
764                           aCurRow := aCurRow + 1;
765                         end
766                       else
767                         if aColID = aCurCol then
768                           begin
769                             z := '';
770                             y := piece(x,'^',2);
771                             if length(y) > 0 then z := y;
772                             y := copy(x, (pos('^', x)+1), 9999);
773                             if pos('^',y) > 0 then
774                               begin
775                                 while pos('^',y) > 0 do
776                                   begin
777                                     y := copy(y, (pos('^', y)+1), 9999);
778                                     z := z + '^' + y;
779                                   end;
780                                 aTmpAray.Add(z);
781                               end
782                             else
783                               begin
784                                 aTmpAray.Add(y);
785                               end;
786                             continue;
787                           end;
788                       if aTmpAray.Count > 0 then
789                         begin
790                           if aColCtr = 1 then
791                             begin
792                               ListItem := Items.Add;
793                               aSite := piece(aTmpAray[0],'^',1);
794                               ListItem.Caption := piece(aSite,';',1);
795                               ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
796                             end
797                           else
798                             begin
799                               c := aTmpAray[0];
800                               if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
801                                 c := c + '...';
802                               ListItem.SubItems.Add(c);
803                             end;
804                           LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
805                           aTmpAray.Clear;
806                         end;
807                       aCurCol := aColID;
808                       Inc(aColCtr);
809                       y := '';
810                       for k := 2 to 10 do
811                         if length(piece(x,'^',k)) > 0 then
812                           begin
813                             if length(y) > 0 then y := y + '^' + piece(x,'^',k)
814                             else y := y + piece(x,'^',k);
815                           end;
816                       aTmpAray.Add(y);
817                       if aColCtr > 0 then
818                         while aColCtr < aCurCol do
819                           begin
820                             ListItem.SubItems.Add('');
821                             Inc(aColCtr);
822                           end;
823                     end;
824                   if aTmpAray.Count > 0 then
825                     begin
826                       if aColCtr = 1 then
827                         begin
828                           ListItem := Items.Add;
829                           aSite := piece(aTmpAray[0],'^',1);
830                           ListItem.Caption := piece(aSite,';',1);
831                           ListItem.SubItems.Add(IntToStr(aCurRow) + ':' + IntToStr(aCurCol));
832                         end
833                       else
834                         begin
835                           c := aTmpAray[0];
836                           if piece(uColumns.Strings[aCurCol],'^',4) = '1' then
837                             c := c + '...';
838                           ListItem.SubItems.Add(c);
839                         end;
840                       LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);
841                       aTmpAray.Clear;
842                     end;
843                 end;
844               aTmpAray.Free;
845             end;
846         end;
847     end;
848     if aErr = 1 then
849       if User.HasKey('XUPROGMODE') then
850         ShowMsg('Programmer message: One or more Column ID''s in file 101.24 do not match ID''s coded in extract routine');
851   end;