Changeset 1679 for cprs/trunk/CPRS-Chart/fReports.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fReports.pas
r830 r1679 172 172 uses ORFn, rCore, rReports, fFrame, uCore, uReports, fReportsPrint, 173 173 fReportsAdhocComponent1, activex, mshtml, dShared, fGraphs, fGraphData, rGraphs, 174 VA508AccessibilityRouter, VAUtils 175 { TODO -oRV -cWVEHR Long Age : Changed to use long age } 176 , rWVEHR; 174 VA508AccessibilityRouter, VAUtils; 177 175 178 176 const … … 278 276 else if GraphForm.btnClose.Tag = 1 then 279 277 Exit 280 else 281 begin 278 else if GraphFormActive and (frmGraphData.pnlData.Hint = Patient.DFN) then 279 begin // displaying same patient 280 if Tag <> reportien then 282 281 with GraphForm do 283 if pnlMain.Tag <> reportien then 284 begin // different report 282 begin // new report 285 283 pnlMain.Tag := reportien; 286 284 Initialize; 285 //DisplayData('top'); 286 //DisplayData('bottom'); 287 287 GtslCheck.Clear; 288 288 GraphPanel(true); 289 289 BringToFront; 290 290 end; 291 //no action 292 end 293 else if frmGraphData.pnlData.Hint = Patient.DFN then 294 begin // same patient, bring back graph 295 GraphPanel(true); 296 BringToFront; 297 GraphFormActive := true; 298 end 299 else 300 with GraphForm do 301 begin // new patient 302 pnlMain.Tag := reportien; 303 Initialize; 304 DisplayData('top'); 305 DisplayData('bottom'); 306 GtslCheck.Clear; 307 frmGraphData.pnlData.Hint := Patient.DFN; 308 GraphPanel(true); 309 BringToFront; 310 GraphFormActive := true; 291 311 end; 292 312 end; … … 420 440 procedure TfrmReports.DisplayPage; 421 441 var 422 i: integer; 442 i{, OrigSelection}: integer; 443 {OrigDateIEN: Int64; 444 OrigDateItemID: Variant; 445 OrigReportCat, OrigProcedure: TTreeNode; } 423 446 begin 424 447 inherited DisplayPage; … … 436 459 + '<TD nowrap><B>Patient: ' + Patient.Name + '</B></TD>' 437 460 + '<TD nowrap><B>' + Patient.SSN + '</B></TD>' 438 { TODO -oRV -cWVEHR Long Age : Changed to use long age } 439 //+ '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>' 440 + '<TD nowrap><B>Age: ' + GetPatientBriefAge(Patient.DFN) + '</B></TD>' 441 {} 461 + '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>' 442 462 + '</TR></TABLE></DIV><HR>'; 443 463 //the preferred method would be to use headers and footers 444 464 //so this is just an interim solution. 445 if not GraphFormActive then446 pnlLeftBottom.Visible := False; 465 {if not GraphFormActive then 466 pnlLeftBottom.Visible := False; } //This was keeping Date Range selection box from appearing when leaving and coming back to this Tab 447 467 if InitPage then 448 468 begin … … 503 523 end; 504 524 CC_NOTIFICATION: ProcessNotifications; 505 end; 525 526 //This corrects the reload of the reports when switching back to the tab. 527 {Remove this since it has already been corrected. Related code was also removed from fLabs. 528 CC_CLICK: if not InitPatient then 529 begin 530 //Clear our local variables 531 OrigReportCat := nil; 532 OrigDateIEN := -1; 533 OrigSelection := -1; 534 OrigDateItemID := ''; 535 OrigProcedure := nil; 536 537 //What was last selected before they switched tabs. 538 if tvReports.Selected <> nil then OrigReportCat := tvReports.Selected; 539 if lstDateRange.ItemIEN > 0 then OrigDateIEN := lstDateRange.ItemIEN; 540 if lvReports.Selected <> nil then OrigSelection := lvReports.Selected.Index; 541 if lstQualifier.ItemID <> '' then OrigDateItemID := lstQualifier.ItemID; 542 if tvProcedures.Selected <> nil then OrigProcedure := tvProcedures.Selected; 543 544 //Load the tree and select the last selected 545 if OrigReportCat <> nil then begin 546 tvReports.Select(OrigReportCat); 547 tvReportsClick(self); 548 end; 549 550 //Did they click on a date (lstDates box) 551 if OrigDateIEN > -1 then begin 552 lstDateRange.SelectByIEN(OrigDateIEN); 553 lstDateRangeClick(self); 554 end; 555 556 //Did they click on a date (lstQualifier) 557 if OrigDateItemID <> '' then begin 558 lstQualifier.SelectByID(OrigDateItemID); 559 lstQualifierClick(self); 560 end; 561 562 //Did they click on a procedure 563 if OrigProcedure <> nil then begin 564 tvProcedures.Select(OrigProcedure); 565 tvProceduresClick(tvProcedures); 566 end; 567 568 569 //Did they click on a report 570 if OrigSelection > -1 then begin 571 lvReports.Selected := lvReports.Items[OrigSelection]; 572 lvReportsSelectItem(self, lvReports.Selected, true); 573 end; 574 end; } 575 end; 506 576 end; 507 577 … … 872 942 var 873 943 MoreID: String; //Restores MaxOcc value 874 aRemote, aHDR, aFHIE : string;944 aRemote, aHDR, aFHIE, aMax: string; 875 945 i: integer; 876 946 begin … … 887 957 SetPiece(uQualifier,';',3,''); 888 958 end; 959 aMax := piece(uQualifier,';',3); 960 if (CharAt(lstQualifier.ItemID,1) = 'd') 961 and (length(aMax)>0) 962 and (StrToInt(aMax)<101) then 963 MoreID := ';101'; 889 964 aRemote := piece(uRemoteType,'^',1); 890 965 aHDR := piece(uRemoteType,'^',7); … … 1097 1172 1098 1173 procedure TfrmReports.GotoTop1Click(Sender: TObject); 1099 var 1100 Current, Desired : Longint; 1101 begin 1102 inherited; 1103 with memText do 1104 begin 1105 SetFocus; 1106 SelStart :=0; 1107 SelLength :=0; 1108 Current := SendMessage(memText.handle, EM_GETFIRSTVISIBLELINE, 0, 0); 1109 Desired := SendMessage(memText.handle, EM_LINEFROMCHAR, 1110 memText.SelStart + memText.SelLength ,0) - 1; 1111 SendMessage(memText.Handle,EM_LINESCROLL, 0, Desired - Current); 1112 end; 1174 begin 1175 inherited; 1176 SendMessage(memText.Handle, WM_VSCROLL, SB_TOP, 0); 1177 {GoToTop1.Enabled := false; 1178 GoToBottom1.Enabled := true; } 1113 1179 end; 1114 1180 1115 1181 procedure TfrmReports.GotoBottom1Click(Sender: TObject); 1116 var1117 Current, Desired : Longint;1118 I,LineCount : Integer;1119 1182 begin 1120 1183 Inherited; 1121 LineCount :=0; 1122 with memText do 1123 begin 1124 for I := 0 to lines.count-1 do 1125 LineCount := LineCount + Length(Lines[I]) + 2; 1126 SetFocus; 1127 SelStart := LineCount; 1128 SelLength :=0; 1129 end; 1130 Current := SendMessage(memText.handle, EM_GETFIRSTVISIBLELINE, 0, 0); 1131 Desired := SendMessage(memText.handle, EM_LINEFROMCHAR, 1132 memText.SelStart + memText.SelLength ,0); 1133 SendMessage(memText.Handle,EM_LINESCROLL, 0, Desired - Current - 5); 1184 SendMessage(memText.Handle, WM_VSCROLL, SB_BOTTOM, 0); 1185 {GoToTop1.Enabled := true; 1186 GoToBottom1.Enabled := false; } 1134 1187 end; 1135 1188 … … 1183 1236 If Memo1.Visible Then 1184 1237 UnFreezeText1.Enabled := True; 1185 If memText.SelStart > 0 then1238 {If memText.SelStart > 0 then 1186 1239 GotoTop1.Enabled := True 1187 1240 Else … … 1191 1244 GotoBottom1.Enabled := True 1192 1245 Else 1193 GotoBottom1.Enabled := False; 1246 GotoBottom1.Enabled := False; } 1194 1247 end; 1195 1248 … … 1306 1359 //OR_AU^Autopsy 1307 1360 begin 1308 if Notifications.AlertData = '^1^^^0^0^0' then 1361 if Notifications.AlertData = '^1^^^0^0^0' then //code snippet to handle the processing of v26 AP alerts in a v27 environment. 1309 1362 begin 1310 1363 if pnlRightMiddle.Visible then pnlRightMiddle.Visible := FALSE; … … 1393 1446 end; 1394 1447 if length(piece(aRanges,';',1)) > 0 then 1395 if uReportType <> 'G' then // graphs don't display date ranges here1396 1448 begin 1397 1449 d1 := ValidDateTimeStr(piece(aRanges,';',1),''); … … 1415 1467 end; 1416 1468 end; 1417 if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE D OD DATA INCLUDED IN REPORT>>';1469 if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE DATA INCLUDED IN REPORT>>'; 1418 1470 Caption := x; 1419 1471 end; … … 1647 1699 if HDRActive = '0' then 1648 1700 begin 1649 InfoBox('The HDR is currently inactive .' + CRLF + 'Unable to retrieve HDR data at this time.', 'HDR Error', MB_OK);1701 InfoBox('The HDR is currently inactive in CPRS.' + CRLF + 'You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK); 1650 1702 Exit; 1651 1703 end; 1652 InfoBox('You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK);1704 //InfoBox('You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK); 1653 1705 if (Piece(AItem, ':', 1) = 'OR_VWAL') or (Piece(AItem, ':', 1) = 'OR_VWRX') then 1654 1706 AQualifier := 'T-50000;T+50000;99999'; … … 1684 1736 if (AHDR='1') and (LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200HD') then 1685 1737 begin 1686 TRemoteSite(Items[i]).Selected := true;1687 frmFrame.lstCIRNLocations.Checked[i+2] := true;1738 //TRemoteSite(Items[i]).Selected := true; 1739 //frmFrame.lstCIRNLocations.Checked[i+1] := true; 1688 1740 end; 1689 1741 if TRemoteSite(Items[i]).Selected then … … 1990 2042 uReportRPC := aRPC; 1991 2043 uRptID := aID; 2044 uReportID := aID; 1992 2045 uDirect := aDirect; 1993 2046 uReportType := aReportType; … … 2243 2296 pnlLeftBottom.Visible := FALSE; 2244 2297 pnlProcedures.Visible := TRUE; 2245 Splitter1.Visible := True; 2298 Splitter1.Visible := True; 2246 2299 if lvReports.Columns.Count > 0 then lvReports.Columns[1].Width := 0; 2247 2300 Items.EndUpdate; … … 2888 2941 FastAssign(TCellObject(RowObjects.ColumnList[j]).Data, aBasket); 2889 2942 for k := 0 to aBasket.Count - 1 do 2890 MemText.Lines.Add(' 2943 MemText.Lines.Add(' ' + aBasket[k]); 2891 2944 end; 2892 2945 if aWPFlag = true then … … 2909 2962 FastAssign(TCellObject(RowObjects.ColumnList[i]).Data, aBasket); 2910 2963 for j := 0 to aBasket.Count - 1 do 2911 MemText.Lines.Add(' 2964 MemText.Lines.Add(' ' + aBasket[j]); 2912 2965 end; 2913 2966 if aWPFlag = true then
Note:
See TracChangeset
for help on using the changeset viewer.