Procedure

TfrmLabs.lstQualifierClick

Module

fLabs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmLabs

Declaration

procedure lstQualifierClick(Sender: TObject);

Calls Hierarchy


TfrmLabs.lstQualifierClick
 ├TfrmLabs.DisplayHeading
 │ └ValidDateTimeStr
 ├TfrmLabs.FMToDateTime
 ├FMToday
 │ └FMNow
 ├TfrmLabs.BeginEndDates
 │ ├TfrmLabs.FMToDateTime
 │ └FMToday...
 ├TfrmLabs.BlankWeb
 ├TRemoteSite.ReportClear
 ├TLabRowObject.Clear
 ├TfrmLabs.GoRemote
 │ ├HDRActive
 │ ├StrToFMDateTime
 │ ├TRemoteSite.SetSelected
 │ ├TRemoteSite.ReportClear
 │ ├TfrmLabs.UpdateRemoteStatus
 │ ├TfrmLabs.LoadListView
 │ │ ├TLabRowObject.Add
 │ │ │ ├TCellObject.Create
 │ │ │ └TCellObject.Add
 │ │ └TUser.HasKey
 │ │   └HasSecurityKey
 │ ├GetRemoteData
 │ ├DirectQuery
 │ └RemoteQuery
 ├LoadReportText
 │ └StrToFMDateTime
 ├TfrmLabs.LoadListView...
 ├TfrmLabs.ShowTabControl
 ├TfrmLabs.GoRemoteOld
 │ ├TRemoteSite.LabClear
 │ ├TfrmLabs.UpdateRemoteStatus
 │ ├GetRemoteData
 │ ├RemoteLabReports
 │ ├RemoteLabCumulative
 │ ├RemoteLabInterim
 │ ├RemoteLabMicro
 │ └RemoteLab
 ├Cumulative
 ├Interim
 ├InterimSelect
 ├Worksheet
 ├TfrmLabs.HGrid
 │ └LabPatchInstalled
 │   └ServerHasPatch
 ├TfrmLabs.VGrid
 │ └LabPatchInstalled...
 ├TfrmLabs.GraphList
 ├TfrmLabs.GridComments
 ├TfrmLabs.ragCorGClick
 │ ├TfrmLabs.chk3DClick
 │ ├TfrmLabs.chkValuesClick
 │ └TfrmLabs.lstTestGraphClick
 │   └TfrmLabs.WorksheetChart
 │     ├TfrmLabs.GetStartStop
 │     ├OkFloatValue
 │     └TfrmLabs.FMToDateTime
 ├TfrmLabs.chkGraphZoomClick
 ├GetChart
 ├TfrmLabs.GraphChart
 │ └TfrmLabs.FMToDateTime
 ├Micro
 └Reports

Called-By Hierarchy


                           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┘         

Calls

Name Declaration Comments
TfrmLabs.BeginEndDates procedure BeginEndDates(var ADate1, ADate2: TFMDateTime; var ADaysBack: integer); -
TfrmLabs.BlankWeb procedure BlankWeb; -
TfrmLabs.chkGraphZoomClick procedure chkGraphZoomClick(Sender: TObject); -
TLabRowObject.Clear procedure Clear; -
Cumulative procedure Cumulative(Dest: TStrings; const PatientDFN: string; daysback: integer; ADate1, ADate2: TFMDateTime; ARpc: string); -
TfrmLabs.DisplayHeading procedure DisplayHeading(aRanges: string); -
TfrmLabs.FMToDateTime function FMToDateTime(FMDateTime: string): TDateTime; -
FMToday function FMToday: TFMDateTime; -
GetChart function GetChart(const PatientDFN: string; ADate1, ADate2: TFMDateTime; spec, test: string): TStrings; -
TfrmLabs.GoRemote procedure GoRemote(Dest: TStringList; AItem: string; AQualifier, ARpc: string; AHSTag: string; AHDR: string; aFHIE: string); -
TfrmLabs.GoRemoteOld procedure GoRemoteOld(Dest: TStringList; AItem, AReportID: Int64; AQualifier, ARpc, AHSType, ADaysBack, ASection: string; ADate1, ADate2: TFMDateTime); -
TfrmLabs.GraphChart procedure GraphChart(test: string; aitems: TStrings); -
TfrmLabs.GraphList procedure GraphList(griddata: TStrings); -
TfrmLabs.GridComments procedure GridComments(aitems: TStrings); -
TfrmLabs.HGrid procedure HGrid(griddata: TStrings); -
Interim procedure Interim(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime; ARpc: string); -
InterimSelect function InterimSelect(const PatientDFN: string; ADate1, ADate2: TFMDateTime; tests: TStrings): TStrings; -
TfrmLabs.LoadListView procedure LoadListView(aReportData: TStringList); -
LoadReportText procedure LoadReportText(Dest: TStrings; ReportType: string; const Qualifier: string; ARpc, AHSTag: string); -
Micro procedure Micro(Dest: TStrings; const PatientDFN: string; ADate1, ADate2: TFMDateTime; ARpc: string); -
TfrmLabs.ragCorGClick procedure ragCorGClick(Sender: TObject); -
TRemoteSite.ReportClear procedure ReportClear; -
Reports procedure Reports(Dest: TStrings; const PatientDFN: string; reportid, hstype, ADate, section: string; Adate1, Adate2: TFMDateTime; ARpc: string); -
TfrmLabs.ShowTabControl procedure ShowTabControl; -
TfrmLabs.VGrid procedure VGrid(griddata: TStrings); -
Worksheet function Worksheet(const PatientDFN: string; ADate1, ADate2: TFMDateTime; spec: string; tests: TStrings): TStrings; -

Called-By

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


Source

1041  procedure TfrmLabs.lstQualifierClick(Sender: TObject);
1042    var
1043    MoreID: String;  //Restores MaxOcc value
1044    aRemote, aHDR, aFHIE, aMax: string;
1045    i: integer;
1046    tmpList: TStringList;
1047    daysback: integer;
1048    date1, date2: TFMDateTime;
1049    today: TDateTime;
1050  begin
1051    inherited;
1052    if uFrozen = True then
1053      begin
1054        memo1.visible := False;
1055        memo1.TabStop := False;
1056      end;
1057    if (lstDates.ItemID = 'S') then
1058    begin
1059      with calLabRange do
1060      begin
1061        if Execute then
1062          if Length(TextOfStart) > 0 then
1063            if Length(TextOfStop) > 0 then
1064              begin
1065                lstDates.ItemIndex := lstDates.Items.Add(RelativeStart + ';' +
1066                  RelativeStop + U + TextOfStart + ' to ' + TextOfStop);
1067                  DisplayHeading('');
1068              end
1069            else
1070              lstDates.ItemIndex := -1
1071          else
1072            lstDates.ItemIndex := -1
1073        else
1074          lstDates.ItemIndex := -1;
1075      end;
1076    end;
1077    today := FMToDateTime(floattostr(FMToday));
1078    if lstDates.ItemIEN > 0 then
1079      begin
1080        daysback := lstDates.ItemIEN;
1081        date1 := FMToday;
1082        If daysback = 1 then
1083          date2 := DateTimeToFMDateTime(today)
1084        Else
1085          date2 := DateTimeToFMDateTime(today - daysback);
1086      end
1087    else
1088      BeginEndDates(date1,date2,daysback);
1089    date1 := date1 + 0.2359;
1090    MoreID := ';' + Piece(uQualifier,';',3);
1091    if chkMaxFreq.checked = true then
1092      begin
1093        MoreID := '';
1094        SetPiece(uQualifier,';',3,'');
1095      end;
1096    aMax := piece(uQualifier,';',3);
1097    if (CharAt(lstQualifier.ItemID,1) = 'd')
1098      and (length(aMax)>0)
1099      and (StrToInt(aMax)<101) then
1100        MoreID := ';101';
1101    Timer1.Interval := 3000;
1102    aRemote :=  piece(uRemoteType,'^',1);
1103    aHDR := piece(uRemoteType,'^',7);
1104    aFHIE := piece(uRemoteType,'^',8);
1105    SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
1106    uHTMLDoc := '';
1107    if uReportType = 'H' then      
1108      begin
1109        WebBrowser1.Visible := true;
1110        WebBrowser1.TabStop := true;
1111        BlankWeb;
1112        WebBrowser1.BringToFront;
1113        memLab.Visible := false;
1114        memLab.TabStop := false;
1115      end
1116    else
1117      begin
1118        WebBrowser1.Visible := false;
1119        WebBrowser1.TabStop := false;
1120        memLab.Visible := true;
1121        memLab.TabStop := true;
1122        memLab.BringToFront;
1123        RedrawActivate(memLab.Handle);
1124      end;  
1125    uLocalReportData.Clear;
1126    uRemoteReportData.Clear;
1127    for i := 0 to RemoteSites.SiteList.Count - 1 do
1128     TRemoteSite(RemoteSites.SiteList.Items[i]).ReportClear;
1129    uRemoteCount := 0;
1130    if aHDR = '1' then
1131      DisplayHeading(lstQualifier.ItemID)
1132    else
1133      DisplayHeading(lstQualifier.ItemID + MoreID);
1134    if lstQualifier.ItemID = 'ds' then
1135      begin
1136        with calLabRange do
1137         if Not (Execute) then
1138           begin
1139             lstQualifier.ItemIndex := -1;
1140             Exit;
1141           end
1142         else if (Length(TextOfStart) > 0) and (Length(TextOfStop) > 0) then
1143           begin
1144             if (Length(piece(uRemoteType,'^',6)) > 0) and (StrToInt(piece(uRemoteType,'^',6)) > 0) then
1145               if abs(FMDateTimeToDateTime(FMDateStart) - FMDateTimeToDateTime(FMDateStop)) > StrToInt(piece(uRemoteType,'^',6)) then
1146                 begin
1147                   InfoBox('The Date Range selected is greater than the' + CRLF + 'Maximum Days Allowed of ' + piece(uRemoteType,'^',6)
1148                     + ' for this report.', 'No Report Generated',MB_OK);
1149                   lstQualifier.ItemIndex := -1;
1150                   exit;
1151                 end;
1152             lstQualifier.ItemIndex := lstQualifier.Items.Add(RelativeStart +
1153               ';' + RelativeStop + U + TextOfStart + ' to ' + TextOfStop);
1154             DisplayHeading(lstQualifier.ItemID + MoreID);
1155             SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
1156           end
1157         else
1158           begin
1159             lstQualifier.ItemIndex := -1;
1160             InfoBox('Invalid Date Range entered. Please try again','Invalid Date/time entry',MB_OK);
1161             if (Execute) and (Length(TextOfStart) > 0) and (Length(TextOfStop) > 0) then
1162               begin
1163                 lstQualifier.ItemIndex := lstQualifier.Items.Add(RelativeStart +
1164                   ';' + RelativeStop + U + TextOfStart + ' to ' + TextOfStop);
1165                 DisplayHeading(lstQualifier.ItemID + MoreID);
1166                 SetPiece(uRemoteType,'^',5,lstQualifier.ItemID);
1167               end
1168             else
1169               begin
1170                 lstQualifier.ItemIndex := -1;
1171                 InfoBox('No Report Generated!','Invalid Date/time entry',MB_OK);
1172                 exit;
1173               end;
1174           end;
1175      end;
1176    if (CharAt(lstQualifier.ItemID,1) = 'd') and (Length(piece(uRemoteType,'^',6)) > 0) and (StrToInt(piece(uRemoteType,'^',6)) > 0) then
1177      if ExtractInteger(lstQualifier.ItemID) > (StrToInt(piece(uRemoteType,'^',6))) then
1178        begin
1179          InfoBox('The Date Range selected is greater than the' + CRLF + 'Maximum Days Allowed of ' + piece(uRemoteType,'^',6)
1180            + ' for this report.', 'No Report Generated',MB_OK);
1181          lstQualifier.ItemIndex := -1;
1182          exit;
1183        end;
1184    Screen.Cursor := crHourGlass;
1185    uReportInstruction := #13#10 + 'Retrieving data...';
1186    memLab.Lines.Add(uReportInstruction);
1187    if WebBrowser1.Visible = true then         
1188    begin
1189      uHTMLDoc := HTML_PRE + uReportInstruction + HTML_POST;
1190      BlankWeb;
1191    end;      
1192    case uQualifierType of
1193        QT_HSCOMPONENT:
1194          begin     //      = 5
1195            lvReports.SmallImages := uEmptyImageList;
1196            lvReports.Items.Clear;
1197            memLab.Lines.Clear;
1198            LabRowObjects.Clear;
1199            if ((aRemote = '1') or (aRemote = '2')) then
1200              GoRemote(uRemoteReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE);
1201            if not(piece(uRemoteType, '^', 9) = '1') then
1202              if (length(piece(uHState,';',2)) > 0) then
1203                begin
1204                  if not(aRemote = '2') then
1205                    LoadReportText(uLocalReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1206                  LoadListView(uLocalReportData);
1207                end
1208              else
1209                begin
1210                  if ((aRemote = '1') or (aRemote = '2')) then
1211                    ShowTabControl;
1212                  LoadReportText(uLocalReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1213                  if uLocalReportData.Count < 1 then
1214                    begin
1215                      uReportInstruction := '<No Report Available>';
1216                      memLab.Lines.Add(uReportInstruction);
1217                    end
1218                  else
1219                    begin
1220                      QuickCopy(uLocalReportData,memLab);
1221                      TabControl1.OnChange(nil);
1222                    end;
1223                end;
1224          end;
1225        QT_HSWPCOMPONENT:
1226          begin      //      = 6
1227            lvReports.SmallImages := uEmptyImageList;
1228            lvReports.Items.Clear;
1229            LabRowObjects.Clear;
1230            memLab.Lines.Clear;
1231            if ((aRemote = '1') or (aRemote = '2'))  then
1232              begin
1233                Screen.Cursor := crDefault;
1234                GoRemote(uRemoteReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE);
1235              end;
1236            if not(piece(uRemoteType, '^', 9) = '1') then
1237              if (length(piece(uHState,';',2)) > 0) then
1238                begin
1239                  if not(aRemote = '2') then
1240                    LoadReportText(uLocalReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1241                  LoadListView(uLocalReportData);
1242                end
1243              else
1244                begin
1245                  {if ((aRemote = '1') or (aRemote = '2')) then
1246                    ShowTabControl;}
1247                  if not (aRemote = '2') then
1248                    begin
1249                      LoadReportText(uLocalReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState);
1250                      if uLocalReportData.Count < 1 then
1251                        begin
1252                          uReportInstruction := '<No Report Available>';
1253                          memLab.Lines.Add(uReportInstruction);
1254                        end
1255                      else
1256                        QuickCopy(uLocalReportData,memLab);
1257                    end;
1258                end;
1259          end
1260        else
1261          begin
1262            Screen.Cursor := crDefault;
1263  case StrToInt(Piece(uRptID,':',1)) of
1264    21: begin                // Cumulative
1265         lstHeaders.Clear;
1266         memLab.Clear;
1267         uLabLocalReportData.Clear;
1268         uLabRemoteReportData.Clear;
1269         StatusText('Retrieving data for cumulative report...');
1270         GoRemoteOld(uLabRemoteReportData,0,2,'',uReportRPC,'',IntToStr(daysback),'',date1,date2);
1271         TabControl1.OnChange(nil);
1272         Cumulative(uLabLocalReportData, Patient.DFN, daysback, date1, date2, uReportRPC);
1273         if uLabLocalReportData.Count > 0 then
1274           begin
1275             TabControl1.OnChange(nil);
1276             if lstHeaders.Items.Count > 0 then lstHeaders.ItemIndex := 0;
1277           end;
1278         memLab.Lines.Insert(0,' ');
1279         memLab.Lines.Delete(0);
1280       end;
1281    3: begin            // Interim
1282         memLab.Clear;
1283         uLabLocalReportData.Clear;
1284         uLabRemoteReportData.Clear;
1285         StatusText('Retrieving data for interim report...');
1286         GoRemoteOld(uLabRemoteReportData,0,3,'',uReportRPC,'','','',date1,date2);
1287         TabControl1.OnChange(nil);
1288         Interim(uLabLocalReportData, Patient.DFN, date1, date2, uReportRPC);
1289         if uLabLocalReportData.Count < 1 then
1290           uLabLocalReportData.Add('<No results for this date range.>');
1291         if TabControl1.TabIndex < 1 then
1292           QuickCopy(uLabLocalReportData,memLab);
1293         memLab.Lines.Insert(0,' ');
1294         memLab.Lines.Delete(0);
1295         memLab.SelStart := 0;
1296       end;
1297    4: begin            // Interim for Selected Tests
1298         memLab.Clear;
1299         uLabLocalReportData.Clear;
1300         uLabRemoteReportData.Clear;
1301         try
1302           StatusText('Retrieving data for selected tests...');
1303           FastAssign(InterimSelect(Patient.DFN, date1, date2, lstTests.Items), uLabLocalReportData);
1304           if uLabLocalReportData.Count > 0 then
1305             QuickCopy(uLabLocalReportData,memLab)
1306           else
1307             memLab.Lines.Add('<No results for selected tests in this date range.>');
1308           memLab.SelStart := 0;
1309         finally
1310           //tmpList.Free;
1311         end;
1312       end;
1313    5: begin            // Worksheet
1314         chtChart.BottomAxis.Automatic := true;
1315         chkZoom.Checked := false;
1316         chkAbnormals.Checked := false;
1317         memLab.Clear;
1318         uLabLocalReportData.Clear;
1319         uLabRemoteReportData.Clear;
1320         grdLab.Align := alClient;
1321         StatusText('Retrieving data for worksheet...');
1322         FastAssign(Worksheet(Patient.DFN, date1, date2,
1323           Piece(lblSpecimen.Caption, '^', 1), lstTests.Items), tmpGrid);
1324         if ragHorV.ItemIndex = 0 then
1325           HGrid(tmpGrid)
1326         else
1327           VGrid(tmpGrid);
1328         GraphList(tmpGrid);
1329         GridComments(tmpGrid);
1330         ragCorGClick(self);
1331       end;
1332    6: begin            // Graph
1333         if not uGraphingActivated then
1334         begin
1335           chtChart.BottomAxis.Automatic := true;
1336           chkGraphZoom.Checked := false;
1337           chkGraphZoomClick(self);
1338           memLab.Clear;
1339           uLabLocalReportData.Clear;
1340           uLabRemoteReportData.Clear;
1341           tmpList := TStringList.Create;
1342           try
1343             StatusText('Retrieving data for graph...');
1344             FastAssign(GetChart(Patient.DFN, date1, date2,
1345               Piece(lblSpecimen.Caption, '^', 1),
1346               Piece(lblSingleTest.Caption, '^', 1)), tmpList);
1347             if tmpList.Count > 1 then
1348             begin
1349               chtChart.Visible := true;
1350               GraphChart(lblSingleTest.Caption, tmpList);
1351               chtChart.ZoomPercent(ZOOM_PERCENT);
1352               for i := strtoint(Piece(tmpList[0], '^', 1)) + 1 to tmpList.Count - 1
1353                 do memLab.Lines.Add(tmpList[i]);
1354               if memLab.Lines.Count < 2 then
1355                 memLab.Lines.Add('<No comments on specimens.>');
1356               memLab.SelStart := 0;
1357               lblGraph.Visible := false;
1358             end
1359             else
1360             begin
1361               lblGraph.Left := chtChart.Left + ((chtChart.Width - lblGraph.Width) div 2);
1362               lblGraph.Top := 2;
1363               lblGraph.Visible := true;
1364               if Piece(lblSpecimen.Caption, '^', 1) = '0' then
1365                 pnlChart.Caption := '<No results can be graphed for ' +
1366                   Piece(lblSingleTest.Caption, '^', 2) + ' in this date range.> '
1367                   + 'Results may be available, but cannot be graphed. Please try an alternate view.'
1368               else
1369                 pnlChart.Caption := '<No results can be graphed for ' +
1370                   Piece(lblSingleTest.Caption, '^', 2)
1371                   + ' (' + Piece(lblSpecimen.Caption, '^', 2) +
1372                     ') in this date range.> '
1373                   + 'Results may be available, but cannot be graphed. Please try an alternate view.';
1374               chtChart.Visible := false;
1375             end;
1376           finally
1377             tmpList.Free;
1378           end;
1379         end;
1380       end;
1381    9: begin            // Micro
1382         memLab.Clear;
1383         uLabLocalReportData.Clear;
1384         uLabRemoteReportData.Clear;
1385         StatusText('Retrieving microbiology data...');
1386         GoRemoteOld(uLabRemoteReportData,0,4,'',uReportRPC,'','','',date1,date2);
1387         TabControl1.OnChange(nil);
1388         Micro(uLabLocalReportData, Patient.DFN, date1, date2, uReportRPC);
1389         if uLabLocalReportData.Count < 1 then
1390           uLabLocalReportData.Add('<No microbiology results for this date range.>');
1391         if TabControl1.TabIndex < 1 then
1392           QuickCopy(uLabLocalReportData,memLab);
1393         memLab.Lines.Insert(0,' ');
1394         memLab.Lines.Delete(0);
1395         memLab.SelStart := 0;
1396       end;
1397    10: begin           // Lab Status
1398         memLab.Clear;
1399         uLabLocalReportData.Clear;
1400         uLabRemoteReportData.Clear;
1401         StatusText('Retrieving lab status data...');
1402         GoRemoteOld(uLabRemoteReportData,9,1,'',uReportRPC,'',IntToStr(daysback),'',date1,date2);
1403         TabControl1.OnChange(nil);
1404         Reports(uLabLocalReportData,Patient.DFN, 'L:' + '9', '', IntToStr(daysback),'',
1405           date1, date2, uReportRPC);
1406         if uLabLocalReportData.Count < 1 then
1407           uLabLocalReportData.Add('<No laboratory orders for this date range.>');
1408         if TabControl1.TabIndex < 1 then
1409           QuickCopy(uLabLocalReportData,memLab);
1410         memLab.Lines.Insert(0,' ');
1411         memLab.Lines.Delete(0);
1412         memLab.SelStart := 0;
1413        end;
1414    else begin          //Anything Else
1415           lstHeaders.Clear;
1416           memLab.Clear;
1417           uLabLocalReportData.Clear;
1418           uLabRemoteReportData.Clear;
1419           StatusText('Retrieving lab data...');
1420           GoRemoteOld(uLabRemoteReportData, 1, 1, '', uReportRPC, '', IntToStr(daysback), '', date1, date2);
1421           //GoRemoteOld(uLabRemoteReportData, StrToInt(Piece(uRptID,'^',1)), 1, '', uReportRPC, '', IntToStr(daysback), '', date1, date2);
1422           TabControl1.OnChange(nil);
1423           Reports(uLabLocalReportData,Patient.DFN, 'L:' + Piece(uRptID,'^',1), '',
1424             IntToStr(daysback), '', date1, date2, uReportRPC);
1425           if uLabLocalReportData.Count < 1 then
1426             uLabLocalReportData.Add('<No data for this date range.>');
1427           if TabControl1.TabIndex < 1 then
1428             QuickCopy(uLabLocalReportData,memLab);
1429           memLab.Lines.Insert(0,' ');
1430           memLab.Lines.Delete(0);
1431           memLab.SelStart := 0;
1432         end;
1433    end;
1434          end;
1435      end;
1436      Screen.Cursor := crDefault;
1437      StatusText('');
1438      memLab.Lines.Insert(0,' ');
1439      memLab.Lines.Delete(0);
1440      if WebBrowser1.Visible = true then          
1441        begin
1442          if uReportType = 'R' then
1443            uHTMLDoc := HTML_PRE + uLocalReportData.Text + HTML_POST
1444          else
1445            uHTMLDoc := uHTMLPatient + uLocalReportData.Text;
1446          BlankWeb;
1447        end;
1448  
1449  end;