Changeset 1679 for cprs/trunk/CPRS-Chart/fLabs.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fLabs.pas
r830 r1679 1 1 unit fLabs; 2 2 3 interface 3 interface 4 4 5 5 uses … … 22 22 23 23 TfrmLabs = class(TfrmHSplit) 24 PopupMenu1: TPopupMenu;25 GotoTop1: TMenuItem;26 GotoBottom1: TMenuItem;27 FreezeText1: TMenuItem;28 UnfreezeText1: TMenuItem;29 24 popChart: TPopupMenu; 30 25 popValues: TMenuItem; … … 61 56 chkGraphZoom: TCheckBox; 62 57 pnlButtons: TORAutoPanel; 63 lblOld: TOROffsetLabel;64 lblPrev: TOROffsetLabel;65 lblNext: TOROffsetLabel;66 lblRecent: TOROffsetLabel;67 58 lblMostRecent: TLabel; 68 lblCollection: TLabel;69 59 lblDate: TVA508StaticText; 70 60 cmdNext: TButton; … … 72 62 cmdRecent: TButton; 73 63 cmdOld: TButton; 74 TabControl1: TTabControl;75 64 grdLab: TCaptionStringGrid; 76 65 pnlChart: TPanel; … … 82 71 serTest: TLineSeries; 83 72 pnlRightTopHeader: TPanel; 84 lblHeading: TOROffsetLabel;85 lblTitle: TOROffsetLabel;86 73 PopupMenu2: TPopupMenu; 87 74 Print1: TMenuItem; … … 92 79 Copy2: TMenuItem; 93 80 SelectAll2: TMenuItem; 94 MenuItem1: TMenuItem;95 MenuItem2: TMenuItem;96 MenuItem3: TMenuItem;97 MenuItem4: TMenuItem;81 GoToTop1: TMenuItem; 82 GoToBottom1: TMenuItem; 83 FreezeText1: TMenuItem; 84 UnFreezeText1: TMenuItem; 98 85 sptHorzRight: TSplitter; 99 86 pnlFooter: TORAutoPanel; … … 117 104 bvlOtherTests: TBevel; 118 105 cmdOtherTests: TButton; 106 TabControl1: TTabControl; 107 pnlRightTopHeaderTop: TPanel; 108 lblHeading: TOROffsetLabel; 119 109 chkMaxFreq: TCheckBox; 110 lblTitle: TOROffsetLabel; 111 Label1: TLabel; 112 lblSample: TLabel; 113 Label2: TLabel; 120 114 procedure FormCreate(Sender: TObject); 121 115 procedure DisplayHeading(aRanges: string); … … 143 137 procedure FreezeText1Click(Sender: TObject); 144 138 procedure UnfreezeText1Click(Sender: TObject); 145 procedure PopupMenu1Popup(Sender: TObject);146 139 procedure chkZoomClick(Sender: TObject); 147 140 procedure chtChartUndoZoom(Sender: TObject); … … 198 191 procedure SelectAll2Click(Sender: TObject); 199 192 procedure chkMaxFreqClick(Sender: TObject); 200 procedure sptHorzRightMoved(Sender: TObject); 193 procedure PopupMenu3Popup(Sender: TObject); 194 procedure grdLabTopLeftChanged(Sender: TObject); 201 195 private 202 196 { Private declarations } … … 219 213 procedure GoRemote(Dest: TStringList; AItem: string; AQualifier, ARpc: string; AHSTag: string; AHDR: string; aFHIE: string); 220 214 procedure ShowTabControl; 215 procedure HideTabControl; 221 216 procedure ChkBrowser; 222 217 procedure CommonComponentVisible(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12: Boolean); … … 235 230 frmLabs: TfrmLabs; 236 231 uFormat: integer; 237 uPrevReportNode: TTreeNode; 232 uPrevReportNode: TTreeNode; 238 233 uDate1, uDate2: Tdatetime; 239 234 tmpGrid: TStringList; … … 241 236 uLabRemoteReportData: TStringList; //Storage for Remote lab query 242 237 uUpdateStat: boolean; //flag turned on when remote status is being updated 243 uScreenSplitMoved: boolean; //set if user moves the sptHorzRight Bar244 238 uScreenSplitLoc: Integer; //location of user changed split - sptHorzRight Bar 245 239 uTreeStrings: TStrings; … … 266 260 uses uCore, rLabs, rCore, rCover, rOrders, fLabPrint, fFrame, fRptBox, Printers, fReportsPrint, 267 261 clipbrd, rReports, rGraphs, activex, mshtml, VA508AccessibilityRouter, uReports, 268 VAUtils 269 { TODO -oRV -cWVEHR Long Age : Changed to use long age } 270 , rWVEHR; 271 262 VAUtils; 272 263 273 264 const … … 405 396 begin 406 397 inherited; 398 LabRowObjects := TLabRowObject.Create; 407 399 PageID := CT_LABS; 408 400 uFrozen := False; 409 uScreenSplitMoved := False;410 401 aList := TStringList.Create; 411 402 FastAssign(rpcGetGraphSettings, aList); … … 424 415 uPrevReportNode := tvReports.Items.GetFirstNode; 425 416 tvReports.Selected := uPrevReportNode; 426 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 5;417 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 4; 427 418 lblSingleTest.Caption := ''; 428 419 lblSpecimen.Caption := ''; … … 490 481 uLabRemoteReportData.Clear; 491 482 TabControl1.Tabs.Clear; 492 TabControl1.Visible := false;483 HideTabControl; 493 484 tmpGrid.Clear; 494 485 lvReports.SmallImages := uEmptyImageList; … … 506 497 var 507 498 i: integer; 499 {OrigSelection: integer; 500 OrigDateIEN: Int64; 501 OrigDateItemID: Variant; 502 OrigReportCat: TTreeNode; } 508 503 begin 509 504 inherited DisplayPage; … … 517 512 + '<TD nowrap><B>Patient: ' + Patient.Name + '</B></TD>' 518 513 + '<TD nowrap><B>' + Patient.SSN + '</B></TD>' 519 { TODO -oRV -cWVEHR Long Age : Changed to use long age } 520 //+ '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>' 521 + '<TD nowrap><B>Age: ' + GetPatientBriefAge(Patient.DFN) + '</B></TD>' 522 {} 514 + '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>' 523 515 + '</TR></TABLE></DIV><HR>'; 524 516 //the preferred method would be to use headers and footers … … 535 527 begin 536 528 uColChange := ''; 537 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 5;529 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 4; 538 530 tvReports.Selected := tvReports.Items.GetFirstNode; 539 531 tvReportsClick(self); … … 571 563 CC_INIT_PATIENT: if not InitPatient then 572 564 begin 573 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 5;565 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 4; 574 566 tvReports.Selected := tvReports.Items.GetFirstNode; 575 567 tvReportsClick(self); … … 590 582 end; 591 583 CC_NOTIFICATION: ProcessNotifications; 584 585 //This corrects the reload of the labs when switching back to the tab. 586 {This code was causing the processing of Lab notifications to display 587 the wrong set of labs for a given notification the 1st notification 588 after selecting/switching patients. Upon checking the problem that 589 this code was trying to solve, we found that the problem no longer 590 exists, which may be a result of subsequent changes for similar 591 issues found during development/testing of V28 (CQ 18267, 18268) 592 CC_CLICK: if not InitPatient then 593 begin 594 //Clear our local variables 595 OrigReportCat := nil; 596 OrigDateIEN := -1; 597 OrigSelection := -1; 598 OrigDateItemID := ''; 599 600 //What was last selected before they switched tabs. 601 if tvReports.Selected <> nil then OrigReportCat := tvReports.Selected; 602 if lstDates.ItemIEN > 0 then OrigDateIEN := lstDates.ItemIEN; 603 if lvReports.Selected <> nil then OrigSelection := lvReports.Selected.Index; 604 if lstQualifier.ItemID <> '' then OrigDateItemID := lstQualifier.ItemID; 605 606 //Load the tree and select the last selected 607 if OrigReportCat <> nil then begin 608 tvReports.Select(OrigReportCat); 609 tvReportsClick(self); 610 end; 611 612 //Did they click on a date (lstDates box) 613 if OrigDateIEN > -1 then begin 614 lstDates.SelectByIEN(OrigDateIEN); 615 lstDatesClick(self); 616 end; 617 618 //Did they click on a date (lstQualifier) 619 if OrigDateItemID <> '' then begin 620 lstQualifier.SelectByID(OrigDateItemID); 621 lstQualifierClick(self); 622 end; 623 624 //Did they click on a lab 625 if OrigSelection > -1 then begin 626 lvReports.Selected := lvReports.Items[OrigSelection]; 627 lvReportsSelectItem(self, lvReports.Selected, true); 628 end; 629 end; } 592 630 end; 593 631 end; … … 695 733 end; 696 734 end; 697 RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);735 LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray); 698 736 aTmpAray.Clear; 699 737 end; … … 740 778 ListItem.SubItems.Add(c); 741 779 end; 742 RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);780 LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray); 743 781 aTmpAray.Clear; 744 782 end; … … 776 814 ListItem.SubItems.Add(c); 777 815 end; 778 RowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray);816 LabRowObjects.Add(aSite, IntToStr(aCurRow) + ':' + IntToStr(aCurCol), uColumns.Strings[aCurCol], aTmpAray); 779 817 aTmpAray.Clear; 780 818 end; … … 815 853 end; 816 854 DaysBack := Copy(aRanges, 2, Length(aRanges)); 855 if DaysBack = '' then DaysBack := '7'; 817 856 if DaysBack = '0' then 818 857 aRanges := 'T' + ';T' 819 858 else 820 aRanges := 'T-' + DaysBack + ';T'; 859 if Copy(aRanges, 2, 1) = 'T' then 860 aRanges := DaysBack + ';T' 861 else 862 aRanges := 'T-' + DaysBack + ';T'; 821 863 end; 822 864 if length(piece(aRanges,';',1)) > 0 then … … 844 886 end; 845 887 end; 846 if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE D OD DATA INCLUDED IN REPORT>>';888 if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE DATA INCLUDED IN REPORT>>'; 847 889 Caption := x; 848 890 end; … … 1235 1277 var 1236 1278 MoreID: String; //Restores MaxOcc value 1237 aRemote, aHDR, aFHIE : string;1279 aRemote, aHDR, aFHIE, aMax: string; 1238 1280 i: integer; 1239 1281 tmpList: TStringList; … … 1287 1329 SetPiece(uQualifier,';',3,''); 1288 1330 end; 1331 aMax := piece(uQualifier,';',3); 1332 if (CharAt(lstQualifier.ItemID,1) = 'd') 1333 and (length(aMax)>0) 1334 and (StrToInt(aMax)<101) then 1335 MoreID := ';101'; 1289 1336 aRemote := piece(uRemoteType,'^',1); 1290 1337 aHDR := piece(uRemoteType,'^',7); … … 1385 1432 lvReports.Items.Clear; 1386 1433 memLab.Lines.Clear; 1387 RowObjects.Clear;1434 LabRowObjects.Clear; 1388 1435 if ((aRemote = '1') or (aRemote = '2')) then 1389 1436 GoRemote(uRemoteReportData, 'L:' + uRptID, lstQualifier.ItemID + MoreID, uReportRPC, uHState, aHDR, aFHIE); … … 1416 1463 lvReports.SmallImages := uEmptyImageList; 1417 1464 lvReports.Items.Clear; 1418 RowObjects.Clear;1465 LabRowObjects.Clear; 1419 1466 memLab.Lines.Clear; 1420 1467 if ((aRemote = '1') or (aRemote = '2')) then … … 1641 1688 uHTMLDoc := uHTMLPatient + uLocalReportData.Text; 1642 1689 WebBrowser1.Navigate('about:blank'); 1643 end; } 1690 end; 1691 } 1644 1692 end; 1645 1693 … … 1711 1759 uLabRemoteReportData.Clear; 1712 1760 StatusText('Retrieving data for cumulative report...'); 1713 GoRemoteOld(uLabRemoteReportData, 0,2,'',uReportRPC,'',IntToStr(daysback),'',date1,date2);1761 GoRemoteOld(uLabRemoteReportData,21,2,'',uReportRPC,'',IntToStr(daysback),'',date1,date2); 1714 1762 TabControl1.OnChange(nil); 1715 1763 Cumulative(uLabLocalReportData, Patient.DFN, daysback, date1, date2, uReportRPC); … … 1728 1776 uLabRemoteReportData.Clear; 1729 1777 StatusText('Retrieving data for interim report...'); 1730 GoRemoteOld(uLabRemoteReportData, 0,3,'',uReportRPC,'','','',date1,date2);1778 GoRemoteOld(uLabRemoteReportData,3,3,'',uReportRPC,'','','',date1,date2); 1731 1779 TabControl1.OnChange(nil); 1732 1780 Interim(uLabLocalReportData, Patient.DFN, date1, date2, uReportRPC); … … 1833 1881 uLabRemoteReportData.Clear; 1834 1882 StatusText('Retrieving microbiology data...'); 1835 GoRemoteOld(uLabRemoteReportData, 0,4,'',uReportRPC,'','','',date1,date2);1883 GoRemoteOld(uLabRemoteReportData,4,4,'',uReportRPC,'','','',date1,date2); 1836 1884 TabControl1.OnChange(nil); 1837 1885 Micro(uLabLocalReportData, Patient.DFN, date1, date2, uReportRPC); … … 1929 1977 end; 1930 1978 1979 procedure TfrmLabs.grdLabTopLeftChanged(Sender: TObject); 1980 var 1981 i: integer; 1982 begin 1983 inherited; 1984 if piece(uRptID,':',1) ='1' then 1985 begin 1986 for i := 2 to grdLab.RowCount do 1987 grdLab.Cells[0,i] := ''; 1988 if not(grdLab.TopRow = 1) then 1989 grdLab.Cells[0,grdLab.TopRow] := lblDate.Caption; 1990 end; 1991 end; 1992 1931 1993 procedure TfrmLabs.HGrid(griddata: TStrings); 1932 1994 var … … 2059 2121 end; 2060 2122 //------------------------------------------------------------------------------------------ 2061 Cells[i - testcnt, 1] := MixedCase(Piece(griddata[i + offset], '^', 4)) ;2123 Cells[i - testcnt, 1] := MixedCase(Piece(griddata[i + offset], '^', 4)) + ' ' + Piece(griddata[i + offset], '^', 5); 2062 2124 end; 2063 2125 for i := testcnt + datecnt + 1 to linecnt do … … 2109 2171 uLocalReportData.Free; 2110 2172 uRemoteReportData.Free; 2173 LabRowObjects.Free; 2111 2174 end; 2112 2175 … … 2119 2182 begin 2120 2183 if testcnt = 0 then RowCount := 3 else RowCount := testcnt + 1; 2121 ColCount := 5;2184 ColCount := 6; 2122 2185 DefaultColWidth := agrid.Width div ColCount - 2; 2123 ColWidths[0] := agrid.Width div 4; 2124 ColWidths[4] := agrid.Width div 4; 2125 ColWidths[2] := agrid.Width div 9; 2126 ColWidths[3] := agrid.Width div 6; 2127 ColWidths[1] := agrid.Width - ColWidths[0] - ColWidths[2] - ColWidths[3] - ColWidths[4] - 8; 2186 ColWidths[0] := 120; //agrid.Width div 6; 2187 ColWidths[1] := agrid.Width div 4; //5 2188 ColWidths[5] := agrid.Width div 7; //5 2189 ColWidths[3] := agrid.Width div 14;//12 2190 ColWidths[4] := agrid.Width div 12;//9 2191 ColWidths[2] := agrid.Width div 5; //agrid.Width - ColWidths[0] - ColWidths[1] - ColWidths[3] - ColWidths[4] - 8; 2128 2192 FixedCols := 0; 2129 2193 FixedRows := 1; … … 2131 2195 for x := 0 to ColCount - 1 do 2132 2196 Cells[x, y] := ''; 2133 Cells[0, 0] := 'Test'; 2134 Cells[1, 0] := 'Result'; 2135 Cells[2, 0] := 'Flag'; 2136 Cells[3, 0] := 'Units'; 2137 Cells[4, 0] := 'Ref Range'; 2197 Cells[0, 0] := 'Collection Date/Time'; 2198 Cells[1, 0] := 'Test'; 2199 Cells[2, 0] := 'Result / Status'; 2200 Cells[3, 0] := 'Flag'; 2201 Cells[4, 0] := 'Units'; 2202 Cells[5, 0] := 'Ref Range'; 2138 2203 for i := 1 to testcnt do 2139 2204 begin 2140 Cells[0, i] := Piece(aitems[i], '^', 2); 2141 Cells[1, i] := Piece(aitems[i], '^', 3); 2142 Cells[2, i] := Piece(aitems[i], '^', 4); 2143 Cells[3, i] := Piece(aitems[i], '^', 5); 2144 Cells[4, i] := Piece(aitems[i], '^', 6); 2205 if i = 1 then Cells[0, i] := lblDate.Caption 2206 else Cells[0, i] := ''; 2207 Cells[1, i] := Piece(aitems[i], '^', 2); 2208 Cells[2, i] := Piece(aitems[i], '^', 3); 2209 Cells[3, i] := Piece(aitems[i], '^', 4); 2210 Cells[4, i] := Piece(aitems[i], '^', 5); 2211 Cells[5, i] := Piece(aitems[i], '^', 6); 2145 2212 end; 2146 2213 end; … … 2167 2234 tmpList: TStringList; 2168 2235 nexton, prevon: boolean; 2169 newest, oldest, DisplayDate: string; 2236 newest, oldest, DisplayDate, aCollection, aSpecimen, aX: string; 2237 i,ix: integer; 2170 2238 begin 2171 2239 tmpList := TStringList.Create; 2172 2240 GetNewestOldest(Patient.DFN, newest, oldest); //****** PATCH 2173 nexton := true;2174 2241 prevon := true; 2242 aCollection := ''; 2243 aSpecimen := ''; 2244 aX := ''; 2245 lblSample.Caption := ''; 2246 lblSample.Color := clBtnFace; 2175 2247 try 2176 2248 FastAssign(InterimGrid(Patient.DFN, adatetime, direction, uFormat), tmpList); … … 2213 2285 if (not prevon) and (uFormat = 2) then 2214 2286 prevon := true; 2287 if Piece(tmpList[0], '^', 2) = 'CH' then 2288 begin 2289 lblSample.Caption := 'Specimen: ' + Piece(tmpList[0], '^', 5); 2290 lblSample.Color := clWindow; 2291 end; 2292 if Piece(tmpList[0], '^', 2) = 'MI' then 2293 begin 2294 for i := 0 to tmpList.Count - 1 do 2295 begin 2296 if i > 5 then break; 2297 if ansiContainsStr(tmpList[i],'Collection sample:') then 2298 begin 2299 ix := 0; 2300 if length(piece(tmpList[i], ':',2)) > 0 then 2301 begin 2302 ix := Length(piece(tmpList[i], ':',2)); 2303 if ix > 15 then ix := ix - 15; 2304 end; 2305 aCollection := ' Sample: ' + LeftStr(piece(tmpList[i], ':',2),ix); 2306 end; 2307 end; 2308 for i := 0 to tmpList.Count - 1 do 2309 begin 2310 if i > 5 then break; 2311 if ansiContainsStr(tmpList[i],'Site/Specimen:') then 2312 begin 2313 aSpecimen := 'Specimen: ' + piece(tmpList[i], ':', 2); 2314 end; 2315 end; 2316 aX := aSpecimen + aCollection; 2317 if Length(aX) > 0 then 2318 begin 2319 lblSample.Caption := aX; 2320 lblSample.Color := clWindow; 2321 end; 2322 end; 2215 2323 end 2216 2324 else … … 2218 2326 lblDateFloat.Caption := ''; 2219 2327 lblDate.Caption := ''; 2328 nexton := false; 2329 prevon := false; 2220 2330 end; 2221 2331 cmdNext.Enabled := nexton; 2222 2332 cmdRecent.Enabled := nexton; 2223 lblNext.Enabled := nexton;2224 lblRecent.Enabled := nexton;2225 2333 cmdPrev.Enabled := prevon; 2226 2334 cmdOld.Enabled := prevon; 2227 lblPrev.Enabled := prevon;2228 lblOld.Enabled := prevon;2229 2335 if cmdOld.Enabled and cmdRecent.Enabled then 2230 2336 lblMostRecent.Visible := false … … 2233 2339 lblMostRecent.Visible := true; 2234 2340 if (not cmdOld.Enabled) and (not cmdRecent.Enabled) then 2235 lblMostRecent.Caption := 'No Lab Results'2341 lblMostRecent.Caption := 'No Lab Data' 2236 2342 else if cmdOld.Enabled then 2237 lblMostRecent.Caption := 'Most Recent Lab Result'2343 lblMostRecent.Caption := 'Most Recent Lab Data' 2238 2344 else 2239 lblMostRecent.Caption := 'Oldest Lab Result';2345 lblMostRecent.Caption := 'Oldest Lab Data'; 2240 2346 end; 2241 2347 if tmpList.Count > 0 then … … 2245 2351 FillGrid(grdLab, tmpList); 2246 2352 FillComments(memLab, tmpList); 2247 if uScreenSplitMoved = false then 2248 begin 2249 pnlRightTop.Height := pnlRight.Height - (pnlRight.Height div 5); 2250 uScreenSplitLoc := sptHorzRight.Top; 2251 end 2252 else 2253 pnlRightTop.Height := uScreenSplitLoc; 2353 pnlRightTop.Height := pnlRight.Height - (pnlRight.Height div 5); 2354 sptHorzRight.Top := pnlRightTop.Height; 2355 uScreenSplitLoc := sptHorzRight.Top; 2254 2356 pnlRightBottom.Height := pnlLeft.Height div 5; 2255 2357 memLab.Height := pnlLeft.Height div 5; … … 2278 2380 pnlFooter.Visible := false; 2279 2381 sptHorzRight.Visible := true; 2280 pnlRightTop.Height := pnlHeader.Height + TabControl1.Height; 2382 TabControl1.Visible := false; 2383 pnlRightTop.Height := pnlHeader.Height; 2281 2384 memLab.Height := pnlRight.Height - (lblHeading.Height + lblTitle.Height + pnlHeader.Height); 2282 2385 pnlRightTop.Visible := true; … … 2389 2492 if numtest > 0 then 2390 2493 begin 2391 for i := 1 to numtest do 2392 if testnum = Piece(aitems[i], '^', 2) then 2393 begin 2394 testorder := inttostr(i); 2395 break; 2396 end; 2397 GetStartStop(start, stop, aitems); 2398 if OKFloatValue(high) then 2399 begin 2400 serHigh.AddXY(FMToDateTime(start), strtofloat(high), '',clTeeColor); 2401 serHigh.AddXY(FMToDateTime(stop), strtofloat(high), '',clTeeColor); 2402 end; 2403 if OKFloatValue(low) then 2404 begin 2405 serLow.AddXY(FMToDateTime(start), strtofloat(low), '',clTeeColor); 2406 serLow.AddXY(FMToDateTime(stop), strtofloat(low), '',clTeeColor); 2407 end; 2408 numspec := Piece(specimen, '^', 1); 2409 chtChart.Legend.Color := grdLab.Color; 2410 chtChart.Title.Font.Size := MainFontSize; 2411 chtChart.LeftAxis.Title.Caption := units; 2412 serTest.Title := Piece(test, '^', 2); 2413 serHigh.Title := 'Ref High ' + high; 2414 serLow.Title := 'Ref Low ' + low; 2415 testcheck := testorder; 2416 for i := numtest + numcol + 1 to numtest + numcol + numvalues do 2417 if Piece(aitems[i], '^', 2) = testcheck then 2418 if Piece(aitems[numtest + strtoint(Piece(aitems[i], '^', 1))], '^', 3) = numspec then 2494 for i := 1 to numtest do 2495 if testnum = Piece(aitems[i], '^', 2) then 2419 2496 begin 2420 value := Piece(aitems[i], '^', 3); 2421 if OkFloatValue(value) then 2497 testorder := inttostr(i); 2498 break; 2499 end; 2500 GetStartStop(start, stop, aitems); 2501 if OKFloatValue(high) then 2502 begin 2503 serHigh.AddXY(FMToDateTime(start), strtofloat(high), '',clTeeColor); 2504 serHigh.AddXY(FMToDateTime(stop), strtofloat(high), '',clTeeColor); 2505 end; 2506 if OKFloatValue(low) then 2507 begin 2508 serLow.AddXY(FMToDateTime(start), strtofloat(low), '',clTeeColor); 2509 serLow.AddXY(FMToDateTime(stop), strtofloat(low), '',clTeeColor); 2510 end; 2511 numspec := Piece(specimen, '^', 1); 2512 chtChart.Legend.Color := grdLab.Color; 2513 chtChart.Title.Font.Size := MainFontSize; 2514 chtChart.LeftAxis.Title.Caption := units; 2515 serTest.Title := Piece(test, '^', 2); 2516 serHigh.Title := 'Ref High ' + high; 2517 serLow.Title := 'Ref Low ' + low; 2518 testcheck := testorder; 2519 for i := numtest + numcol + 1 to numtest + numcol + numvalues do 2520 if Piece(aitems[i], '^', 2) = testcheck then 2521 if Piece(aitems[numtest + strtoint(Piece(aitems[i], '^', 1))], '^', 3) = numspec then 2422 2522 begin 2423 labvalue := strtofloat(value); 2424 datevalue := FMToDateTime(Piece(aitems[numtest + strtoint(Piece(aitems[i], '^', 1))], '^', 2)); 2425 serTest.AddXY(datevalue, labvalue, '', clTeeColor); 2426 inc(valuecount); 2523 value := Piece(aitems[i], '^', 3); 2524 if OkFloatValue(value) then 2525 begin 2526 labvalue := strtofloat(value); 2527 datevalue := FMToDateTime(Piece(aitems[numtest + strtoint(Piece(aitems[i], '^', 1))], '^', 2)); 2528 serTest.AddXY(datevalue, labvalue, '', clTeeColor); 2529 inc(valuecount); 2530 end; 2427 2531 end; 2428 end;2429 2532 end; 2430 2533 if valuecount = 0 then … … 2980 3083 begin 2981 3084 aSID := Items[i].SubItems[0]; 2982 for j := 0 to RowObjects.ColumnList.Count - 1 do2983 if piece(aSID,':',1) = piece(TCellObject( RowObjects.ColumnList[j]).Handle,':',1) then2984 if Item.Caption = (piece(TCellObject( RowObjects.ColumnList[j]).Site,';',1)) then2985 if (TCellObject( RowObjects.ColumnList[j]).Data.Count > 0) and2986 (TCellObject( RowObjects.ColumnList[j]).Include = '1') then3085 for j := 0 to LabRowObjects.ColumnList.Count - 1 do 3086 if piece(aSID,':',1) = piece(TCellObject(LabRowObjects.ColumnList[j]).Handle,':',1) then 3087 if Item.Caption = (piece(TCellObject(LabRowObjects.ColumnList[j]).Site,';',1)) then 3088 if (TCellObject(LabRowObjects.ColumnList[j]).Data.Count > 0) and 3089 (TCellObject(LabRowObjects.ColumnList[j]).Include = '1') then 2987 3090 begin 2988 3091 aWPFlag := true; 2989 MemLab.Lines.Add(TCellObject( RowObjects.ColumnList[j]).Name);2990 FastAssign(TCellObject( RowObjects.ColumnList[j]).Data, aBasket);3092 MemLab.Lines.Add(TCellObject(LabRowObjects.ColumnList[j]).Name); 3093 FastAssign(TCellObject(LabRowObjects.ColumnList[j]).Data, aBasket); 2991 3094 for k := 0 to aBasket.Count - 1 do 2992 MemLab.Lines.Add(' 3095 MemLab.Lines.Add(' ' + aBasket[k]); 2993 3096 end; 2994 3097 if aWPFlag = true then … … 3001 3104 aBasket.Clear; 3002 3105 aWPFlag := false; 3003 for i := 0 to RowObjects.ColumnList.Count - 1 do3004 if piece(aID,':',1) = piece(TCellObject( RowObjects.ColumnList[i]).Handle,':',1) then3005 if Item.Caption = (piece(TCellObject( RowObjects.ColumnList[i]).Site,';',1)) then3006 if (TCellObject( RowObjects.ColumnList[i]).Data.Count > 0) and3007 (TCellObject( RowObjects.ColumnList[i]).Include = '1') then3106 for i := 0 to LabRowObjects.ColumnList.Count - 1 do 3107 if piece(aID,':',1) = piece(TCellObject(LabRowObjects.ColumnList[i]).Handle,':',1) then 3108 if Item.Caption = (piece(TCellObject(LabRowObjects.ColumnList[i]).Site,';',1)) then 3109 if (TCellObject(LabRowObjects.ColumnList[i]).Data.Count > 0) and 3110 (TCellObject(LabRowObjects.ColumnList[i]).Include = '1') then 3008 3111 begin 3009 3112 aWPFlag := true; 3010 MemLab.Lines.Add(TCellObject( RowObjects.ColumnList[i]).Name);3011 FastAssign(TCellObject( RowObjects.ColumnList[i]).Data, aBasket);3113 MemLab.Lines.Add(TCellObject(LabRowObjects.ColumnList[i]).Name); 3114 FastAssign(TCellObject(LabRowObjects.ColumnList[i]).Data, aBasket); 3012 3115 for j := 0 to aBasket.Count - 1 do 3013 MemLab.Lines.Add(' 3116 MemLab.Lines.Add(' ' + aBasket[j]); 3014 3117 end; 3015 3118 if aWPFlag = true then … … 3120 3223 begin 3121 3224 inherited; 3122 with memLab do 3123 begin 3124 SetFocus; 3125 SelStart :=0; 3126 SelLength :=0; 3127 end; 3225 SendMessage(memLab.Handle, WM_VSCROLL, SB_TOP, 0); 3226 {GoToTop1.Enabled := false; 3227 GoToBottom1.Enabled := true; } 3128 3228 end; 3129 3229 3130 3230 procedure TfrmLabs.GotoBottom1Click(Sender: TObject); 3131 var3132 I,CharCount : Integer;3133 3231 begin 3134 3232 Inherited; 3135 CharCount :=0; 3136 with memLab do 3137 begin 3138 for I := 0 to lines.count-1 do 3139 CharCount := CharCount + Length(Lines[I]) + 2; 3140 SetFocus; 3141 SelStart := CharCount; 3142 SelLength :=0; 3143 end; 3233 SendMessage(memLab.Handle, WM_VSCROLL, SB_BOTTOM, 0); 3234 {GoToTop1.Enabled := true; 3235 GoToBottom1.Enabled := false; } 3144 3236 end; 3145 3237 … … 3177 3269 end; 3178 3270 3179 procedure TfrmLabs.PopupMenu 1Popup(Sender: TObject);3271 procedure TfrmLabs.PopupMenu3Popup(Sender: TObject); 3180 3272 begin 3181 3273 inherited; … … 3191 3283 If Memo1.Visible Then 3192 3284 UnFreezeText1.Enabled := True; 3193 If memLab.SelStart > 0 then3285 {If memLab.SelStart > 0 then 3194 3286 GotoTop1.Enabled := True 3195 3287 Else … … 3199 3291 GotoBottom1.Enabled := True 3200 3292 Else 3201 GotoBottom1.Enabled := False; 3293 GotoBottom1.Enabled := False; } 3202 3294 {case lstReports.ItemIEN of 3203 3295 1: FreezeText1.Enabled := False; … … 3233 3325 if StrToIntDef(OrderIFN,0) > 0 then 3234 3326 begin 3235 //the following if condition & clause resolves CQ 16405 & 17076 - a mixture of two different patient's lab results in one display .3327 //the following if condition & clause resolves CQ 16405 & 17076 - a mixture of two different patient's lab results in one display (TC). 3236 3328 if (AnsiContainsStr(tvReports.Selected.Text, 'Microbiology')) or (AnsiContainsStr(tvReports.Selected.Text, 'Anatomic Pathology')) 3237 3329 or (AnsiContainsStr(tvReports.Selected.Text, 'Cytology')) or (AnsiContainsStr(tvReports.Selected.Text, 'Electron Microscopy')) 3238 3330 or (AnsiContainsStr(tvReports.Selected.Text, 'Surgical Pathology')) and (lvReports.Visible = TRUE) then 3239 3331 begin 3240 tvReports.Selected := tvReports.TopItem;3241 3332 lvReports.Visible := FALSE; 3242 DisplayHeading('');3243 3333 end; 3334 tvReports.Selected := tvReports.TopItem; //moved here to fix the conflicting lab results caption header that is displayed with the alert message text. 3335 DisplayHeading(''); //fixes part B of CQ #17548 - CPRS v28.1 (TC) 3244 3336 lstDates.ItemIndex := -1; 3245 3337 Memo1.Visible := false; … … 3270 3362 else 3271 3363 begin 3272 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 5;3364 if Patient.Inpatient then lstDates.ItemIndex := 2 else lstDates.ItemIndex := 4; 3273 3365 tvReports.Selected := tvReports.Items.GetFirstNode; 3274 3366 tvReportsClick(self); … … 3518 3610 procedure TfrmLabs.Timer1Timer(Sender: TObject); 3519 3611 var 3520 i,j : integer;3612 i,j,fail: integer; 3521 3613 r0: String; 3522 3614 begin … … 3526 3618 for i := 0 to Count - 1 do 3527 3619 if TRemoteSite(Items[i]).Selected then 3620 begin 3528 3621 if Length(TRemoteSite(Items[i]).LabRemoteHandle) > 0 then 3529 3622 begin 3530 3623 r0 := GetRemoteStatus(TRemoteSite(Items[i]).LabRemoteHandle); 3531 3624 TRemoteSite(Items[i]).LabQueryStatus := r0; //r0='1^Done' if no errors 3625 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, piece(r0,'^',2)); 3532 3626 if piece(r0,'^',1) = '1' then 3533 3627 begin 3628 GetRemoteData(TRemoteSite(Items[i]).LabData, 3629 TRemoteSite(Items[i]).LabRemoteHandle,Items[i]); 3534 3630 RemoteReports.Add(TRemoteSite(Items[i]).CurrentLabQuery, 3535 3631 TRemoteSite(Items[i]).LabRemoteHandle); 3536 GetRemoteData(TRemoteSite(Items[i]).LabData,3537 TRemoteSite(Items[i]).LabRemoteHandle,Items[i]);3538 3632 TRemoteSite(Items[i]).LabRemoteHandle := ''; 3539 3633 TabControl1.OnChange(nil); 3634 if (length(piece(uHState,';',2)) > 0) then 3635 begin 3636 uRemoteReportData.Clear; 3637 QuickCopy(TRemoteSite(Items[i]).LabData,uRemoteReportData); 3638 fail := 0; 3639 if uRemoteReportData.Count > 0 then 3640 begin 3641 if uRemoteReportData[0] = 'Report not available at this time.' then 3642 begin 3643 fail := 1; 3644 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID,'Report not available'); 3645 end; 3646 if piece(uRemoteReportData[0],'^',1) = '-1' then 3647 begin 3648 fail := 1; 3649 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID,'Communication failure'); 3650 end; 3651 if fail = 0 then 3652 LoadListView(uRemoteReportData); 3653 end; 3654 end; 3540 3655 end 3541 3656 else 3542 3657 begin 3543 3658 uRemoteCount := uRemoteCount + 1; 3544 if uRemoteCount > 60 then //5minute limit3659 if uRemoteCount > 90 then //~7 minute limit 3545 3660 begin 3546 T imer1.Enabled := False;3661 TRemoteSite(Items[i]).LabRemoteHandle := ''; 3547 3662 TRemoteSite(Items[i]).LabQueryStatus := '-1^Timed out'; 3548 3663 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'Timed out'); … … 3554 3669 + TRemoteSite(Items[i]).SiteName + '...'); 3555 3670 end; 3556 Timer1.Interval := 5000;3671 Timer1.Interval := 10000; 3557 3672 end; 3673 end; 3558 3674 if Timer1.Enabled = True then 3559 3675 begin 3560 3676 j := 0; 3561 3677 for i := 0 to Count -1 do 3562 if Length(TRemoteSite(Items[i]).LabRemoteHandle) > 0 then 3563 j := 1; 3678 begin 3679 if Length(TRemoteSite(Items[i]).LabRemoteHandle) > 0 then 3680 begin 3681 j := 1; 3682 break; 3683 end; 3684 end; 3564 3685 if j = 0 then //Shutdown timer if all sites have been processed 3565 3686 begin … … 3570 3691 for i := 0 to Count -1 do 3571 3692 if TRemoteSite(Items[i]).Selected = true then 3572 j := 1; 3693 begin 3694 j := 1; 3695 break; 3696 end; 3573 3697 if j = 0 then //Shutdown timer if user has de-selected all sites 3574 3698 begin … … 3584 3708 var 3585 3709 i: integer; 3586 ListItem: TListItem;3587 3710 aHeading, aReportType, aRPC, aQualifier, aStartTime, aStopTime, aMax, aRptCode, aRemote, aCategory, aSortOrder, aDaysBack, x, x1, x2: string; 3588 3711 aIFN, aOldID: integer; 3589 aID, aHSTag, aRadParam, aColChange, aDirect, aHDR, aFHIE, aFHIEONLY, aQualifierID: string; 3590 CurrentParentNode, CurrentNode: TTreeNode; 3591 begin 3592 inherited; 3712 aID, aHSTag, aColChange, aDirect, aHDR, aFHIE, aFHIEONLY, aQualifierID: string; 3713 CurrentNode: TTreeNode; 3714 begin 3715 inherited; 3716 if (Length(lblHeading.Caption) > 0) and (Length(frmFrame.stsArea.Panels.Items[1].Text) > 0) then 3717 begin //ProcessNotfications post-cleanup and clearing of notification message text 3718 lblHeading.Caption := ''; //in the header and status bar display when clicking to view lab results. 3719 frmFrame.stsArea.Panels.Items[1].Text := ''; 3720 end; 3593 3721 lvReports.Hint := 'To sort, click on column headers|'; 3594 3722 tvReports.TopItem := tvReports.Selected; … … 3638 3766 uReportRPC := aRPC; 3639 3767 uRptID := aID; 3768 uLabRepID := aID; 3640 3769 uDirect := aDirect; 3641 3770 uReportType := aReportType; … … 3648 3777 uHState := aHSTag; 3649 3778 Timer1.Enabled := False; 3650 TabControl1.Visible := false; 3651 TabControl1.TabStop := false; 3779 HideTabControl; 3652 3780 sptHorzRight.Visible := true; 3653 3781 lvReports.Visible := false; 3654 3782 if (aRemote = '1') or (aRemote = '2') then 3655 3783 if not(uReportType = 'V') then 3656 if TabControl1.Tabs.Count > 1 then 3657 begin 3658 TabControl1.Visible := true; 3659 TabControl1.TabStop := true; 3660 pnlRightTop.Height := lblTitle.Height + TabControl1.Height; 3661 end; 3784 ShowTabControl; 3662 3785 StatusText(''); 3663 3786 uHTMLDoc := ''; … … 3669 3792 lvReports.Items.Clear; 3670 3793 lvReports.Columns.Clear; 3671 lblHeading.Caption := ''; //clears Notification text to reduce confusion with lblTitle.Caption.3672 3794 DisplayHeading(''); 3673 3795 if uReportType = 'H' then … … 3738 3860 end; 3739 3861 uLocalReportData.Clear; 3740 RowObjects.Clear;3862 LabRowObjects.Clear; 3741 3863 uRemoteReportData.Clear; 3742 3864 lstHeaders.Visible := false; … … 3835 3957 uPrevReportNode := tvReports.Selected; 3836 3958 end 3837 else tvReports.Selected := uPrevReportNode; 3959 else 3960 begin 3961 uPrevReportNode := tvReports.Items.GetFirstNode; 3962 tvReports.Selected := uPrevReportNode; 3963 tvReportsClick(self); 3964 end; 3838 3965 end 3839 3966 else if aID = '5:WORKSHEET' then … … 3864 3991 //chkZoom.Checked := false; 3865 3992 //chkZoomClick(self); 3866 lstDatesClick(self);3993 //lstDatesClick(self); 3867 3994 //lstQualifierClick(self); 3868 3995 cmdOtherTests.SetFocus; 3869 3996 cmdOtherTests.Default := true; 3870 3997 uPrevReportNode := tvReports.Selected; 3998 if lstDates.ItemIndex = -1 then 3999 if Patient.Inpatient then lstDates.ItemIndex := 2 4000 else lstDates.ItemIndex := 4; 4001 //for i := 1 to lstDates.Count - 1 do //Sets default date range to next item > 1 Month (which should be 6 months) 4002 //if strToInt(piece(lstDates.Items[i],'^',1)) > 31 then 4003 //begin 4004 //lstDates.ItemIndex := i; 4005 //break; 4006 //end; 4007 lstDatesClick(self); 3871 4008 if ScreenReaderSystemActive then 3872 4009 grdLab.SetFocus; 3873 4010 end 3874 else tvReports.Selected := uPrevReportNode; 4011 else 4012 begin 4013 uPrevReportNode := tvReports.Items.GetFirstNode; 4014 tvReports.Selected := uPrevReportNode; 4015 tvReportsClick(self); 4016 end; 3875 4017 end 3876 4018 … … 3943 4085 end 3944 4086 else 3945 tvReports.Selected := uPrevReportNode; 4087 tvReports.Selected := uPrevReportNode; 3946 4088 end; 3947 4089 end … … 3957 4099 sptHorzRight.Visible := false; 3958 4100 pnlRightTop.Height := lblHeading.Height; 4101 if ((aRemote = '1') or (aRemote = '2')) then 4102 ShowTabControl; 4103 pnlRightTopHeader.Align := alTop; 3959 4104 pnlRightTop.Align := alTop; 4105 TabControl1.Align := alTop; 3960 4106 pnlRightBottom.Align := alclient; 3961 4107 sptHorzRight.Visible := true; 3962 4108 pnlRightBottom.Visible := true; 3963 4109 lvReports.Visible := false; 3964 memLab.Height := pnlRight.Height - (lblHeading.Height + lblTitle.Height);3965 4110 memLab.Align := alClient; 4111 if lstDates.ItemIndex = -1 then 4112 if Patient.Inpatient then lstDates.ItemIndex := 2 4113 else lstDates.ItemIndex := 4; 4114 {for i := 1 to lstDates.Count - 1 do //Sets default date range to next item > 1 Month (which should be 6 months) 4115 if strToInt(piece(lstDates.Items[i],'^',1)) > 31 then 4116 begin 4117 lstDates.ItemIndex := i; 4118 break; 4119 end; } 3966 4120 FormResize(self); 3967 4121 aOldID := 1; … … 3984 4138 CommonComponentVisible(false,false,false,false,false,false,false,false,false,false,false,false); 3985 4139 StatusText('Retrieving data...'); 3986 GoRemoteOld(uLabRemoteReportData, 0,aOldID,'',uReportRPC,'0','9999','1',0,0);4140 GoRemoteOld(uLabRemoteReportData,StrToInt(Piece(aID,':',1)),aOldID,'',uReportRPC,'0','9999','1',0,0); 3987 4141 //GoRemote(uRemoteReportData, aID, aRptCode, aRPC, uHState, aHDR, aFHIE); 3988 4142 TabControl1.OnChange(nil); … … 4011 4165 lstHeaders.Clear; 4012 4166 StatusText('Retrieving data...'); 4013 GoRemoteOld(uLabRemoteReportData, 0,aOldID,'',uReportRPC,'0','9999','1',0,0);4167 GoRemoteOld(uLabRemoteReportData,StrToInt(Piece(aID,':',1)),aOldID,'',uReportRPC,'0','9999','1',0,0); 4014 4168 //GoRemote(uRemoteReportData, aID, aRptCode, aRPC, uHState, aHDR, aFHIE); 4015 4169 TabControl1.OnChange(nil); … … 4098 4252 lvReports.SmallImages := uEmptyImageList; 4099 4253 lvReports.Items.Clear; 4100 RowObjects.Clear;4254 LabRowObjects.Clear; 4101 4255 memLab.Lines.Clear; 4102 4256 if (length(piece(aHSTag,';',2)) > 0) then … … 4188 4342 QT_HSWPCOMPONENT: 4189 4343 begin // = 6 4190 if uScreenSplitMoved = false then 4191 begin 4192 pnlRightTop.Height := pnlRight.Height - (pnlRight.Height div 2); 4193 uScreenSplitLoc := sptHorzRight.Top; 4194 end 4195 else 4196 pnlRightTop.Height := uScreenSplitLoc; 4344 pnlRightTop.Height := pnlRight.Height - (pnlRight.Height div 2); 4345 sptHorzRight.top := pnlRightTop.Height; 4346 uScreenSplitLoc := sptHorzRight.Top; 4197 4347 pnlLeftBottom.Visible := false; 4198 4348 splitter1.Visible := false; … … 4205 4355 memLab.Visible := true; 4206 4356 TabControl1.OnChange(nil); 4207 RowObjects.Clear;4357 LabRowObjects.Clear; 4208 4358 memLab.Lines.Clear; 4209 4359 lvReports.SmallImages := uEmptyImageList; 4210 4360 lvReports.Items.Clear; 4361 memLab.Repaint; 4211 4362 if (length(piece(aHSTag,';',2)) > 0) then 4212 4363 begin … … 4456 4607 begin 4457 4608 TRemoteSite(Items[i]).Selected := true; 4458 frmFrame.lstCIRNLocations.Checked[i+ 2] := true;4609 frmFrame.lstCIRNLocations.Checked[i+1] := true; 4459 4610 end; 4460 4611 if TRemoteSite(Items[i]).Selected then … … 4463 4614 if (LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200HD') and not(AHDR = '1') then 4464 4615 begin 4465 TRemoteSite(Items[i]). QueryStatus := '1^Not Included';4616 TRemoteSite(Items[i]).LabQueryStatus := '1^Not Included'; 4466 4617 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'NOT INCLUDED'); 4467 TRemoteSite(Items[i]). RemoteHandle := '';4468 TRemoteSite(Items[i]). QueryStatus := '1^Done';4618 TRemoteSite(Items[i]).LabRemoteHandle := ''; 4619 TRemoteSite(Items[i]).LabQueryStatus := '1^Done'; 4469 4620 if uQualifierType = 6 then seq := '1^'; 4470 4621 TRemoteSite(Items[i]).Data.Add(seq + TRemoteSite(Items[i]).SiteName); … … 4478 4629 if (AHDR = '1') and not(LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200HD') then 4479 4630 begin 4480 TRemoteSite(Items[i]). QueryStatus := '1^Not Included';4631 TRemoteSite(Items[i]).LabQueryStatus := '1^Not Included'; 4481 4632 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'NOT INCLUDED'); 4482 TRemoteSite(Items[i]). RemoteHandle := '';4483 TRemoteSite(Items[i]). QueryStatus := '1^Done';4633 TRemoteSite(Items[i]).LabRemoteHandle := ''; 4634 TRemoteSite(Items[i]).LabQueryStatus := '1^Done'; 4484 4635 if uQualifierType = 6 then seq := '1^'; 4485 4636 TRemoteSite(Items[i]).Data.Add(seq + TRemoteSite(Items[i]).SiteName); … … 4493 4644 if (LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200') and not(aFHIE = '1') then 4494 4645 begin 4495 TRemoteSite(Items[i]). QueryStatus := '1^Not Included';4646 TRemoteSite(Items[i]).LabQueryStatus := '1^Not Included'; 4496 4647 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'NOT INCLUDED'); 4497 TRemoteSite(Items[i]). RemoteHandle := '';4498 TRemoteSite(Items[i]). QueryStatus := '1^Done';4648 TRemoteSite(Items[i]).LabRemoteHandle := ''; 4649 TRemoteSite(Items[i]).LabQueryStatus := '1^Done'; 4499 4650 if uQualifierType = 6 then seq := '1^'; 4500 4651 TRemoteSite(Items[i]).Data.Add(seq + TRemoteSite(Items[i]).SiteName); … … 4525 4676 begin 4526 4677 GetRemoteData(TRemoteSite(Items[i]).Data,LocalHandle,Items[i]); 4527 TRemoteSite(Items[i]). RemoteHandle := '';4528 TRemoteSite(Items[i]). QueryStatus := '1^Done';4678 TRemoteSite(Items[i]).LabRemoteHandle := ''; 4679 TRemoteSite(Items[i]).LabQueryStatus := '1^Done'; 4529 4680 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'Done'); 4530 4681 TabControl1.OnChange(nil); … … 4537 4688 begin 4538 4689 StatusText('Retrieving reports from ' + TRemoteSite(Items[i]).SiteName + '...'); 4539 TRemoteSite(Items[i]). QueryStatus := '1^Direct Call';4690 TRemoteSite(Items[i]).LabQueryStatus := '1^Direct Call'; 4540 4691 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'Direct Call'); 4541 4692 DirectQuery(Dest, AItem, HSType, Daysback, ExamID, Alpha, Omega, TRemoteSite(Items[i]).SiteID, ARpc, AHSTag); 4542 4693 if Copy(Dest[0],1,2) = '-1' then 4543 4694 begin 4544 TRemoteSite(Items[i]). QueryStatus := '-1^Communication error';4695 TRemoteSite(Items[i]).LabQueryStatus := '-1^Communication error'; 4545 4696 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID,'Communication error'); 4546 4697 if uQualifierType = 6 then seq := '1^'; … … 4555 4706 begin 4556 4707 QuickCopy(Dest,TRemoteSite(Items[i]).Data); 4557 TRemoteSite(Items[i]). RemoteHandle := '';4558 TRemoteSite(Items[i]). QueryStatus := '1^Done';4708 TRemoteSite(Items[i]).LabRemoteHandle := ''; 4709 TRemoteSite(Items[i]).LabQueryStatus := '1^Done'; 4559 4710 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'Done'); 4560 4711 TabControl1.OnChange(nil); … … 4569 4720 if Dest[0] = '' then 4570 4721 begin 4571 TRemoteSite(Items[i]). QueryStatus := '-1^Communication error';4722 TRemoteSite(Items[i]).LabQueryStatus := '-1^Communication error'; 4572 4723 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID,'Communication error'); 4573 4724 if uQualifierType = 6 then seq := '1^'; … … 4581 4732 else 4582 4733 begin 4583 TRemoteSite(Items[i]). RemoteHandle := Dest[0];4584 TRemoteSite(Items[i]). QueryStatus := '0^initialization...';4734 TRemoteSite(Items[i]).LabRemoteHandle := Dest[0]; 4735 TRemoteSite(Items[i]).LabQueryStatus := '0^initialization...'; 4585 4736 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'initialization'); 4586 4737 Timer1.Enabled := True; … … 4597 4748 var 4598 4749 i,j: integer; 4599 LocalHandle, Report, Query , seq: String;4750 LocalHandle, Report, Query: String; 4600 4751 begin 4601 4752 { AReportID := 1 Generic report RemoteLabReports … … 4603 4754 3 Interim RemoteLabInterim 4604 4755 4 Microbioloby RemoteLabMicro } 4605 seq := ''; 4756 4606 4757 with RemoteSites.SiteList do 4607 4758 for i := 0 to Count - 1 do … … 4618 4769 if (LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200') then 4619 4770 begin 4620 TRemoteSite(Items[i]). QueryStatus := '1^Not Included';4771 TRemoteSite(Items[i]).LabQueryStatus := '1^Not Included'; 4621 4772 UpdateRemoteStatus(TRemoteSite(Items[i]).SiteID, 'NOT INCLUDED'); 4622 4773 TabControl1.OnChange(nil); … … 4624 4775 end; 4625 4776 TRemoteSite(Items[i]).CurrentLabQuery := 'Lab' + Patient.DFN + ';' + Patient.ICN + 4626 '^' + IntToStr(AItem) + '^' + 'L:' +IntToStr(AReportID) + '^^' + ARpc + '^' + AHSType +4777 '^' + 'L:' + IntToStr(AItem) + '^' + IntToStr(AReportID) + '^^' + ARpc + '^' + AHSType + 4627 4778 '^' + ADaysBack + '^' + ASection + '^' + DateToStr(ADate1) + '^' + DateToStr(ADate2) + '^' + 4628 4779 TRemoteSite(Items[i]).SiteID; … … 4651 4802 case AReportID of 4652 4803 1: begin 4653 RemoteLabReports(Dest, Patient.DFN + ';' + Patient.ICN, IntToStr(AItem),4804 RemoteLabReports(Dest, Patient.DFN + ';' + Patient.ICN, 'L:' + IntToStr(AItem), 4654 4805 AHSType, ADaysBack, ASection, ADate1, ADate2, 4655 4806 TRemoteSite(Items[i]).SiteID, ARpc); … … 4668 4819 end; 4669 4820 else begin 4670 RemoteLab(Dest, Patient.DFN + ';' + Patient.ICN, IntToStr(AItem),4821 RemoteLab(Dest, Patient.DFN + ';' + Patient.ICN, 'L:' + IntToStr(AItem), 4671 4822 AHSType, ADaysBack, ASection, ADate1, ADate2, 4672 4823 TRemoteSite(Items[i]).SiteID, ARpc); … … 4698 4849 begin 4699 4850 inherited; 4700 memLab.Lines.Clear; 4851 if (uQualifiertype <> 6) or (length(piece(uHState,';',2)) < 1) then 4852 memLab.Lines.Clear; 4701 4853 lstHeaders.Items.Clear; 4702 with TabControl1 do4854 if (length(piece(uHState,';',2)) = 0) then with TabControl1 do 4703 4855 begin 4704 4856 memLab.Lines.BeginUpdate; … … 4714 4866 for i := 1 to TRemoteSite(Tabs.Objects[TabIndex]).LabData.Count - 1 do 4715 4867 if hook = true then 4716 memLab.Lines.Add(TRemoteSite(Tabs.Objects[TabIndex]).LabData[i])4868 memLab.Lines.Add(TRemoteSite(Tabs.Objects[TabIndex]).LabData[i]) 4717 4869 else 4718 4870 begin … … 4730 4882 memLab.Lines.Add('Remote data transmission error: ' + Piece(aStatus,'^',2)); 4731 4883 if Piece(aStatus,'^',1) = '0' then 4732 memLab.Lines.Add(' Transmission in progress:' + Piece(aStatus,'^',2));4884 memLab.Lines.Add('Retrieving data... ' + Piece(aStatus,'^',2)); 4733 4885 if Piece(aStatus,'^',1) = '' then 4734 memLab.Lines.Add( 'Select a report...');4886 memLab.Lines.Add(uReportInstruction); 4735 4887 end 4736 4888 else … … 4752 4904 end 4753 4905 else 4754 QuickCopy(uLabLocalReportData,memLab); 4906 if tvReports.Selected.Text = 'Imaging (local only)' then 4907 memLab.Lines.clear 4908 else 4909 QuickCopy(uLabLocalReportData,memLab); 4755 4910 memLab.Lines.Insert(0,' '); 4756 4911 memLab.Lines.Delete(0); 4757 end; 4912 end 4913 else 4914 memLab.Lines.Add(uReportInstruction); 4758 4915 memLab.SelStart := 0; 4759 4916 memLab.Lines.EndUpdate; … … 4799 4956 procedure TfrmLabs.CommonComponentVisible(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12: Boolean); 4800 4957 begin 4958 //Clear the last date selection 4959 //if not A4 then lstDates.ItemIndex := -1; 4960 lstDates.Caption := lblDates.Caption; 4961 lstHeaders.Caption := lblHeaders.Caption; 4962 if A4 or A2 or A12 then 4963 begin 4964 pnlLefTop.Height := (frmLabs.Height div 2); 4965 pnlLeftBottom.Visible := true; 4966 Splitter1.Visible := true; 4967 end 4968 else 4969 begin 4970 pnlLefTop.Height := frmLabs.Height; 4971 pnlLeftBottom.Visible := false; 4972 Splitter1.Visible := false; 4973 end; 4801 4974 lstDates.Visible := false; // turned off to realign correctly 4802 4975 lblDates.Visible := false; … … 4819 4992 pnlFooter.Visible := A9; 4820 4993 lvReports.Visible := A10; 4821 sptHorzRight.Visible := A10;4994 sptHorzRight.Visible := true; 4822 4995 if A4 and A1 and (lblDates.Top < lblHeaders.Top) then 4823 begin 4824 lblDates.Caption := 'Headings'; // swithes captions if not aligned 4825 lblHeaders.Caption := 'Date Range'; 4826 end 4827 else 4828 begin 4829 lblDates.Caption := 'Date Range'; 4830 lblHeaders.Caption := 'Headings'; 4831 end; 4832 lstDates.Caption := lblDates.Caption; 4833 lstHeaders.Caption := lblHeaders.Caption; 4834 if A4 or A2 or A12 then 4835 begin 4836 pnlLeftBottom.Visible := true; 4837 Splitter1.Visible := true; 4838 end; 4996 begin 4997 lblDates.Caption := 'Headings'; // swithes captions if not aligned 4998 lblHeaders.Caption := 'Date Range'; 4999 end 5000 else 5001 begin 5002 lblDates.Caption := 'Date Range'; 5003 lblHeaders.Caption := 'Headings'; 5004 end; 5005 frmLabs.Realign; 4839 5006 end; 4840 5007 … … 4845 5012 TabControl1.Visible := true; 4846 5013 TabControl1.TabStop := true; 4847 pnlRightTop.Height := lblTitle.Height + TabControl1.Height; 4848 end; 5014 pnlRightTopHeader.Height := pnlRightTopHeaderTop.Height + TabControl1.Height; 5015 end; 5016 end; 5017 5018 procedure TfrmLabs.HideTabControl; 5019 begin 5020 TabControl1.Visible := false; 5021 TabControl1.TabStop := false; 5022 pnlRightTopHeader.Height := pnlRightTopHeaderTop.Height; 4849 5023 end; 4850 5024 … … 4861 5035 begin 4862 5036 inherited; 4863 if NewSize < 10 then 4864 Newsize := 10; 4865 end; 4866 4867 procedure TfrmLabs.sptHorzRightMoved(Sender: TObject); 4868 begin 4869 inherited; 4870 uScreenSplitMoved := true; 4871 uScreenSplitLoc := sptHorzRight.Top; 5037 if NewSize < 5 then 5038 Newsize := 5; 4872 5039 end; 4873 5040
Note:
See TracChangeset
for help on using the changeset viewer.