Procedure

TfrmReports.lstQualifierClick

Module

fReports

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmReports

Declaration

procedure lstQualifierClick(Sender: TObject);

Calls Hierarchy


TfrmReports.lstQualifierClick
 ├TfrmReports.BlankWeb
 ├TRemoteSite.ReportClear
 ├TfrmReports.DisplayHeading
 │ └ValidDateTimeStr
 ├TRowObject.Clear
 ├TfrmReports.GoRemote
 │ ├HDRActive
 │ ├StrToFMDateTime
 │ ├TRemoteSite.ReportClear
 │ ├TfrmReports.UpdateRemoteStatus
 │ ├TfrmReports.LoadListView
 │ │ ├TRowObject.Add
 │ │ │ ├TCellObject.Create
 │ │ │ └TCellObject.Add
 │ │ └TUser.HasKey
 │ │   └HasSecurityKey
 │ ├GetRemoteData
 │ ├DirectQuery
 │ └RemoteQuery
 ├LoadReportText
 │ └StrToFMDateTime
 ├TfrmReports.LoadListView...
 ├TfrmReports.ShowTabControl
 ├FormatECSDate
 │ └StrToFMDateTime
 └LoadECSReportText

Called-By Hierarchy


                        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...┘   

Calls

Name Declaration Comments
TfrmReports.BlankWeb procedure BlankWeb; -
TRowObject.Clear procedure Clear; -
TfrmReports.DisplayHeading procedure DisplayHeading(aRanges: string); -
FormatECSDate procedure FormatECSDate(ADTStr: string; var AnECSRpt: TECSReport); -
TfrmReports.GoRemote procedure GoRemote(Dest: TStringList; AItem: string; AQualifier, ARpc: string; AHSTag: string; AHDR: string; aFHIE: string); -
LoadECSReportText procedure LoadECSReportText(Dest: TStrings; AnECSRpt: TECSReport); -
TfrmReports.LoadListView procedure LoadListView(aReportData: TStringList); -
LoadReportText procedure LoadReportText(Dest: TStrings; ReportType: string; const Qualifier: string; ARpc, AHSTag: string); -
TRemoteSite.ReportClear procedure ReportClear; -
TfrmReports.ShowTabControl procedure ShowTabControl; -

Called-By

Name Declaration Comments
TfrmReports.tvReportsClick procedure tvReportsClick(Sender: TObject); -


Source

958   procedure TfrmReports.lstQualifierClick(Sender: TObject);
959   var
960     MoreID: String;  //Restores MaxOcc value
961     aRemote, aHDR, aFHIE, aMax: string;
962     i: integer;
963   begin
964     inherited;
965     if uFrozen = True then
966       begin
967         memo1.visible := False;
968         memo1.TabStop := False;
969       end;
970     MoreID := ';' + Piece(uQualifier,';',3);
971     if chkMaxFreq.checked = true then
972       begin
973         MoreID := '';
974         SetPiece(uQualifier,';',3,'');
975       end;
976     aMax := piece(uQualifier,';',3);
977     if (CharAt(lstQualifier.ItemID,1) = 'd')
978       and (length(aMax)>0)
979       and (StrToInt(aMax)<101) then
980         MoreID := ';101';
981     Timer1.Interval := 3000;
982     aRemote :=  piece(uRemoteType,'^',1);
983     aHDR := piece(uRemoteType,'^',7);
984     aFHIE := piece(uRemoteType,'^',8);
985     SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
986     uHSComponents.Clear;
987     uHSAll.Clear;
988     tvProcedures.Items.Clear;
989     lblProcTypeMsg.Visible := FALSE;
990     uHTMLDoc := '';
991     if uReportType = 'H' then
992       begin
993         WebBrowser1.Visible := true;
994         WebBrowser1.TabStop := true;
995         BlankWeb;
996         WebBrowser1.BringToFront;
997         memText.Visible := false;
998         memText.TabStop := false;
999       end
1000    else
1001      begin
1002        WebBrowser1.Visible := false;
1003        WebBrowser1.TabStop := false;
1004        memText.Visible := true;
1005        memText.TabStop := true;
1006        memText.BringToFront;
1007        RedrawActivate(memText.Handle);
1008      end;
1009    uLocalReportData.Clear;
1010    uRemoteReportData.Clear;
1011    for i := 0 to RemoteSites.SiteList.Count - 1 do
1012     TRemoteSite(RemoteSites.SiteList.Items[i]).ReportClear;
1013    uRemoteCount := 0;
1014    if aHDR = '1' then
1015      DisplayHeading(lstQualifier.ItemID)
1016    else
1017      DisplayHeading(lstQualifier.ItemID + MoreID);
1018    if lstQualifier.ItemID = 'ds' then
1019      begin
1020        with calApptRng do
1021         if Not (Execute) then
1022           begin
1023             lstQualifier.ItemIndex := -1;
1024             Exit;
1025           end
1026         else if (Length(TextOfStart) > 0) and (Length(TextOfStop) > 0) then
1027           begin
1028             if (Length(piece(uRemoteType,'^',6)) > 0) and (StrToInt(piece(uRemoteType,'^',6)) > 0) then
1029               if abs(FMDateTimeToDateTime(FMDateStart) - FMDateTimeToDateTime(FMDateStop)) > StrToInt(piece(uRemoteType,'^',6)) then
1030                 begin
1031                   InfoBox('The Date Range selected is greater than the' + CRLF + 'Maximum Days Allowed of ' + piece(uRemoteType,'^',6)
1032                     + ' for this report.', 'No Report Generated',MB_OK);
1033                   lstQualifier.ItemIndex := -1;
1034                   exit;
1035                 end;
1036             lstQualifier.ItemIndex := lstQualifier.Items.Add(RelativeStart +
1037               ';' + RelativeStop + U + TextOfStart + ' to ' + TextOfStop);
1038             DisplayHeading(lstQualifier.ItemID + MoreID);
1039             SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
1040           end
1041         else
1042           begin
1043             lstQualifier.ItemIndex := -1;
1044             InfoBox('Invalid Date Range entered. Please try again','Invalid Date/time entry',MB_OK);
1045             if (Execute) and (Length(TextOfStart) > 0) and (Length(TextOfStop) > 0) then
1046               begin
1047                 lstQualifier.ItemIndex := lstQualifier.Items.Add(RelativeStart +
1048                   ';' + RelativeStop + U + TextOfStart + ' to ' + TextOfStop);
1049                 DisplayHeading(lstQualifier.ItemID + MoreID);
1050                 SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
1051               end
1052             else
1053               begin
1054                 lstQualifier.ItemIndex := -1;
1055                 InfoBox('No Report Generated!','Invalid Date/time entry',MB_OK);
1056                 exit;
1057               end;
1058           end;
1059      end;
1060    if (CharAt(lstQualifier.ItemID,1) = 'd') and (Length(piece(uRemoteType,'^',6)) > 0) and (StrToInt(piece(uRemoteType,'^',6)) > 0) then
1061      if ExtractInteger(lstQualifier.ItemID) > (StrToInt(piece(uRemoteType,'^',6))) then
1062        begin
1063          InfoBox('The Date Range selected is greater than the' + CRLF + 'Maximum Days Allowed of ' + piece(uRemoteType,'^',6)
1064            + ' for this report.', 'No Report Generated',MB_OK);
1065          lstQualifier.ItemIndex := -1;
1066          exit;
1067        end;
1068    StatusText('Retrieving ' + lblTitle.Caption + '...');
1069    Screen.Cursor := crHourGlass;
1070    uReportInstruction := #13#10 + 'Retrieving data...';
1071    memText.Lines.Add(uReportInstruction);
1072    if WebBrowser1.Visible = true then
1073    begin
1074      uHTMLDoc := HTML_PRE + uReportInstruction + HTML_POST;
1075      BlankWeb;
1076    end;
1077    case uQualifierType of
1078        QT_HSCOMPONENT:
1079          begin     //      = 5
1080            lvReports.SmallImages := uEmptyImageList;
1081            imgLblImages.ComponentImageListChanged;
1082            lvReports.Items.Clear;
1083            memText.Lines.Clear;
1084            RowObjects.Clear;
1085            if ((aRemote = '1') or (aRemote = '2')) then
1086              GoRemote(uRemoteReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE);
1087            if not(piece(uRemoteType, '^', 9) = '1') then
1088              if (length(piece(uHState,';',2)) > 0) then
1089                begin
1090                  if not(aRemote = '2') then
1091                    LoadReportText(uLocalReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1092                  LoadListView(uLocalReportData);
1093                end
1094              else
1095                begin
1096                  if ((aRemote = '1') or (aRemote = '2')) then
1097                    ShowTabControl;
1098                  pnlRightMiddle.Visible := false;
1099                  LoadReportText(uLocalReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1100                  if uLocalReportData.Count < 1 then
1101                    begin
1102                      uReportInstruction := '<No Report Available>';
1103                      memText.Lines.Add(uReportInstruction);
1104                    end
1105                  else
1106                    begin
1107                      QuickCopy(uLocalReportData,memText);
1108                      TabControl1.OnChange(nil);
1109                    end;
1110                end;
1111          end;
1112        QT_HSWPCOMPONENT:
1113          begin      //      = 6
1114            lvReports.SmallImages := uEmptyImageList;
1115            imgLblImages.ComponentImageListChanged;
1116            lvReports.Items.Clear;
1117            RowObjects.Clear;
1118            memText.Lines.Clear;
1119            if ((aRemote = '1') or (aRemote = '2'))  then
1120              begin
1121                Screen.Cursor := crDefault;
1122                GoRemote(uRemoteReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE);
1123              end;
1124            if not(piece(uRemoteType, '^', 9) = '1') then
1125              if (length(piece(uHState,';',2)) > 0) then
1126                begin
1127                  if not(aRemote = '2') then
1128                    LoadReportText(uLocalReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1129                  LoadListView(uLocalReportData);
1130                end
1131              else
1132                begin
1133                  if ((aRemote = '1') or (aRemote = '2')) then
1134                    ShowTabControl;
1135                  pnlRightMiddle.Visible := false;
1136                  if not (aRemote = '2') then
1137                    begin
1138                      LoadReportText(uLocalReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1139                      if uLocalReportData.Count < 1 then
1140                        begin
1141                          uReportInstruction := '<No Report Available>';
1142                          memText.Lines.Add(uReportInstruction);
1143                        end
1144                      else
1145                        QuickCopy(uLocalReportData,memText);
1146                    end;
1147                end;
1148          end
1149        else
1150          begin
1151            Screen.Cursor := crDefault;
1152            GoRemote(uRemoteReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE);
1153            if Pos('ECS',Piece(uRptID,':',1))>0 then
1154            begin
1155              if Pos('OR_ECS1',uRptID)>0 then
1156                uECSReport.ReportHandle := 'ECPCER';
1157              if Pos('OR_ECS2',uRptID)>0 then
1158                uECSReport.ReportHandle := 'ECPAT';
1159              uECSReport.ReportType   := 'D';
1160              if uECSReport.ReportHandle = 'ECPAT' then
1161              begin
1162                if InfoBox('Would you like the procedure reason be included in the report?', 'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
1163                  uECSReport.NeedReason := 'Y'
1164                else
1165                  uECSReport.NeedReason := 'N';
1166              end;
1167              FormatECSDate(lstQualifier.ItemID, uECSReport);
1168              LoadECSReportText(uLocalReportData, uECSReport);
1169            end else
1170              if not(piece(uRemoteType, '^', 9) = '1') then
1171                LoadReportText(uLocalReportData, uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1172            if not(piece(uRemoteType, '^', 9) = '1') then
1173              if TabControl1.TabIndex < 1 then
1174                QuickCopy(uLocalReportData,memText);
1175          end;
1176      end;
1177      Screen.Cursor := crDefault;
1178      StatusText('');
1179      memText.Lines.Insert(0,' ');
1180      memText.Lines.Delete(0);
1181      if WebBrowser1.Visible = true then
1182        begin
1183          if uReportType = 'R' then
1184            uHTMLDoc := HTML_PRE + uLocalReportData.Text + HTML_POST
1185          else
1186            uHTMLDoc := uHTMLPatient + uLocalReportData.Text;
1187          BlankWeb;
1188        end;
1189  end;