Changeset 830 for cprs/trunk/CPRS-Chart/fFrame.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fFrame.pas
r456 r830 14 14 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Tabs, ComCtrls, 15 15 ExtCtrls, Menus, StdCtrls, Buttons, ORFn, fPage, uConst, ORCtrls, Trpcb, 16 OleCtrls, VERGENCECONTEXTORLib_TLB, ComObj, AppEvnts; 16 OleCtrls, VERGENCECONTEXTORLib_TLB, ComObj, AppEvnts, fBase508Form, 17 VA508AccessibilityManager 18 { TODO -oRV -cWVEHR Long Age : Changed to use long age } 19 , rWVEHR; 17 20 18 21 type 19 TfrmFrame = class(T Form)22 TfrmFrame = class(TfrmBase508Form) 20 23 pnlToolbar: TPanel; 21 24 stsArea: TStatusBar; … … 47 50 mnuEditPref: TMenuItem; 48 51 Prefs1: TMenuItem; 49 mnu24pt1: TMenuItem;50 52 mnu18pt1: TMenuItem; 51 53 mnu14pt1: TMenuItem; … … 83 85 lblPtCare: TStaticText; 84 86 lblPtAttending: TStaticText; 85 pnlCIRN: TKeyClickPanel;86 lblCIRN: TLabel;87 lblCIRNData: TLabel;88 87 pnlReminders: TKeyClickPanel; 89 88 imgReminder: TImage; … … 125 124 laVAA2: TButton; 126 125 laMHV: TButton; 127 lblCIRNAvail: TLabel;128 126 mnuViewInformation: TMenuItem; 129 127 mnuViewVisits: TMenuItem; … … 133 131 mnuViewFlags: TMenuItem; 134 132 mnuViewRemoteData: TMenuItem; 133 compAccessTabPage: TVA508ComponentAccessibility; 134 pnlRemoteData: TKeyClickPanel; 135 pnlVistaWeb: TKeyClickPanel; 136 lblVistaWeb: TLabel; 137 pnlCIRN: TKeyClickPanel; 138 lblCIRN: TLabel; 135 139 procedure tabPageChange(Sender: TObject); 136 140 procedure FormCreate(Sender: TObject); … … 139 143 Shift: TShiftState; X, Y: Integer); 140 144 procedure pnlPatientMouseUp(Sender: TObject; Button: TMouseButton; 141 Shift: TShiftState; X, Y: Integer);142 procedure pnlVisitMouseDown(Sender: TObject; Button: TMouseButton;143 Shift: TShiftState; X, Y: Integer);144 procedure pnlVisitMouseUp(Sender: TObject; Button: TMouseButton;145 145 Shift: TShiftState; X, Y: Integer); 146 146 procedure mnuFileExitClick(Sender: TObject); … … 171 171 procedure mnuGECStatusClick(Sender: TObject); 172 172 procedure mnuFileNextClick(Sender: TObject); 173 procedure stsAreaMouseDown(Sender: TObject; Button: TMouseButton;174 Shift: TShiftState; X, Y: Integer);175 procedure stsAreaMouseUp(Sender: TObject; Button: TMouseButton;176 Shift: TShiftState; X, Y: Integer);177 procedure stsAreaDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel;178 const Rect: TRect);179 173 procedure pnlPrimaryCareMouseDown(Sender: TObject; 180 174 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); … … 241 235 procedure ViewInfo(Sender: TObject); 242 236 procedure mnuViewInformationClick(Sender: TObject); 237 procedure compAccessTabPageCaptionQuery(Sender: TObject; 238 var Text: string); 239 procedure pnlVistaWebClick(Sender: TObject); 240 procedure pnlVistaWebMouseDown(Sender: TObject; Button: TMouseButton; 241 Shift: TShiftState; X, Y: Integer); 242 procedure pnlVistaWebMouseUp(Sender: TObject; Button: TMouseButton; 243 Shift: TShiftState; X, Y: Integer); 243 244 private 245 FProccessingNextClick : boolean; 244 246 FJustEnteredApp : boolean; 245 247 FCCOWInstalled: boolean; … … 261 263 FNextButtonActive: Boolean; 262 264 FNextButtonBitmap: TBitmap; 265 FNextButton: TBitBtn; 263 266 FTerminate: Boolean; 264 267 FTabChanged: TNotifyEvent; … … 271 274 FFlagList: TStringList; 272 275 FPrevPtID: string; 273 FVitalsDLLActive: boolean;274 276 FGraphFloatActive: boolean; 275 277 FGraphContext: string; 278 FDoNotChangeEncWindow: boolean; 279 FOrderPrintForm: boolean; 280 FReviewclick: boolean; 281 FCtrlTabUsed: boolean; 276 282 procedure RefreshFixedStatusWidth; 277 283 procedure FocusApplicationTopForm; … … 318 324 procedure CheckForDifferentUser(aContextItemCollection: IDispatch; var UserChanged: boolean); 319 325 {$ENDIF} 320 procedure HideEverything ;326 procedure HideEverything(AMessage: string = 'No patient is currently selected.'); 321 327 procedure ShowEverything; 322 328 //function FindBestCCOWDFN(var APatientName: string): string; 323 329 function FindBestCCOWDFN: string; 324 330 procedure HandleCCOWError(AMessage: string); 331 procedure SetUpNextButton; 332 procedure NextButtonClick(Sender: TObject); 333 procedure NextButtonMouseDown(Sender: TObject; Button: TMouseButton; 334 Shift: TShiftState; X, Y: Integer); 325 335 public 326 EnduringPtSelSplitterPos : integer;336 EnduringPtSelSplitterPos, frmFrameHeight, pnlPatientSelectedHeight: integer; 327 337 procedure SetBADxList; 338 procedure SetActiveTab(PageID: Integer); 328 339 329 340 function PageIDToTab(PageID: Integer): Integer; … … 332 343 function TabExists(ATabID: integer): boolean; 333 344 procedure DisplayEncounterText; 345 function DLLActive: boolean; 334 346 property ChangeSource: Integer read FChangeSource; 335 347 property CCOWContextChanging: Boolean read FCCOWContextChanging; … … 340 352 property Closing: Boolean read FClosing; 341 353 property OnTabChanged: TNotifyEvent read FTabChanged write FTabChanged; 342 property VitalsDLLActive: boolean read FVitalsDLLActive write FVitalsDLLActive;343 354 property GraphFloatActive: boolean read FGraphFloatActive write FGraphFloatActive; 344 355 property GraphContext: string read FGraphContext write FGraphContext; 345 356 procedure ToggleMenuItemChecked(Sender: TObject); 346 357 procedure SetUpCIRN; 358 property DoNotChangeEncWindow: boolean read FDoNotChangeEncWindow write FDoNotChangeEncWindow; 359 property OrderPrintForm: boolean read FOrderPrintForm write FOrderPrintForm; 347 360 end; 348 361 … … 354 367 ctxContextor : TContextorControl; 355 368 NextTab, LastTab: Integer; 356 uToolsMaxed, uToolsWarned : boolean;369 uToolsMaxed, uToolsWarned, uUseVistaWeb: boolean; 357 370 358 371 const … … 370 383 fxLists, fxServer, ORSystem, fRptBox, fSplash, rODAllergy, uInit, fLabTests, fLabInfo, 371 384 uReminders, fReminderTree, ORClasses, fDeviceSelect, fDrawers, fReminderDialog, ShellAPI, rVitals, 372 fOptions, fGraphs, rTemplates, fSurgery, rSurgery, uEventHooks, uSignItems, fDefaultEvent,rECS,373 f IconLegend, uOrders, fPtSelOptns, DateUtils, uSpell, uOrPtf, fPatientFlagMulti,374 fAlertForward, UBAGlobals, fBAOptionsDiagnoses, UBACore, fOrdersSign, uVitals, fOrdersRenew, uFormMonitor385 fOptions, fGraphs, fGraphData, rTemplates, fSurgery, rSurgery, uEventHooks, uSignItems, 386 fDefaultEvent, rECS, fIconLegend, uOrders, fPtSelOptns, DateUtils, uSpell, uOrPtf, fPatientFlagMulti, 387 fAlertForward, UBAGlobals, fBAOptionsDiagnoses, UBACore, fOrdersSign, uVitals, fOrdersRenew, fMHTest, uFormMonitor 375 388 {$IFDEF CCOWBROKER} 376 389 , CCOW_const 377 390 {$ENDIF} 378 ; 391 , VA508AccessibilityRouter, fOtherSchedule, VAUtils, uVA508CPRSCompatibility, fIVRoutes, 392 fPrintLocation, fTemplateEditor; 379 393 380 394 var // RV 05/11/04 … … 453 467 454 468 procedure TfrmFrame.TimeOutAction; 455 begin 456 if frmFrame.VitalsDLLActive then 457 CloseVitalsDLL() 458 else 459 Close; 469 var 470 ClosingCPRS: boolean; 471 472 procedure CloseCPRS; 473 begin 474 if ClosingCPRS then 475 halt; 476 try 477 ClosingCPRS := TRUE; 478 Close; 479 except 480 halt; 481 end; 482 end; 483 484 begin 485 ClosingCPRS := FALSE; 486 try 487 if assigned(frmOtherSchedule) then frmOtherSchedule.Close; 488 if assigned (frmIVRoutes) then frmIVRoutes.Close; 489 if frmFrame.DLLActive then 490 begin 491 CloseVitalsDLL(); 492 CloseMHDLL(); 493 end; 494 CloseCPRS; 495 except 496 CloseCPRS; 497 end; 460 498 end; 461 499 … … 478 516 ErrMsg := ErrMsg + CRLF + 'Address was ' + IntToStr(Integer(AnAddr)); 479 517 end; 480 ShowM essage(ErrMsg);518 ShowMsg(ErrMsg); 481 519 end 482 520 else if (E is EBrokerError) then … … 507 545 FContextChanging := True; 508 546 Result := True; 509 if COMObjectActive or SpellCheckInProgress or VitalsDLLActive then547 if COMObjectActive or SpellCheckInProgress or DLLActive then 510 548 begin 511 549 Reason := 'COM_OBJECT_ACTIVE'; … … 523 561 if Result then Result := frmLabs.AllowContextChange(Reason);; 524 562 if Result then Result := frmReports.AllowContextChange(Reason); 563 if Result then Result := frmGraphData.AllowContextChange(Reason); 525 564 if (not User.IsReportsOnly) then 526 565 if Result and Changes.RequireReview then //Result := ReviewChanges(TimedOut); … … 546 585 { call all pages to make sure patient related information is cleared (when switching patients) } 547 586 begin 548 if frmFrame.Timedout then Exit; // added to correct Access Violation when "Refresh Patient Information" selected587 //if frmFrame.Timedout then Exit; // added to correct Access Violation when "Refresh Patient Information" selected 549 588 lblPtName.Caption := ''; 550 589 lblPtSSN.Caption := ''; … … 552 591 pnlPatient.Caption := ''; 553 592 lblPtCWAD.Caption := ''; 554 lblPtLocation.Caption := 'Visit Not Selected'; 555 lblPtProvider.Caption := 'Current Provider Not Selected'; 556 pnlVisit.Caption := lblPtLocation.Caption + CRLF + lblPtProvider.Caption; 593 if DoNotChangeEncWindow = false then 594 begin 595 lblPtLocation.Caption := 'Visit Not Selected'; 596 lblPtProvider.Caption := 'Current Provider Not Selected'; 597 pnlVisit.Caption := lblPtLocation.Caption + CRLF + lblPtProvider.Caption; 598 end; 557 599 lblPtCare.Caption := 'Primary Care Team Unassigned'; 558 600 lblPtAttending.Caption := ''; … … 567 609 if Assigned(frmSurgery) then frmSurgery.ClearPtData; 568 610 frmLabs.ClearPtData; 611 frmGraphData.ClearPtData; 569 612 frmReports.ClearPtData; 570 613 tabPage.TabIndex := PageIDToTab(CT_NOPAGE); // to make sure DisplayPage gets called … … 572 615 ClearReminderData; 573 616 SigItems.Clear; 617 Changes.Clear; 574 618 lstCIRNLocations.Clear; 575 619 uRemoteType := ''; … … 584 628 DisplayData('top'); 585 629 DisplayData('bottom'); 586 lstCheck.Items.Clear;630 GtslCheck.Clear; 587 631 Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name); 632 end; 633 if frmFrame.TimedOut then 634 begin 635 infoBox('CPRS has encountered a serious problem and is unable to display the selected patient''s data. This is a known issue documented in PSPO 1089.' 636 + 'To prevent patient safety issues, CPRS is shutting down. Shutting down and then restarting CPRS will correct the problem, and you may continue working in CPRS.' 637 + CRLF + CRLF + 'Please report all occurrences of this problem by contacting your CPRS Help Desk.', 'CPRS Error', MB_OK); 638 frmFrame.Close; 588 639 end; 589 640 end; … … 592 643 { updates the display in the header bar of encounter related information (location & provider) } 593 644 begin 645 if DoNotChangeEncWindow = true then exit; 594 646 with Encounter do 595 647 begin … … 605 657 end; 606 658 659 function TfrmFrame.DLLActive: boolean; 660 begin 661 Result := (VitalsDLLHandle <> 0) or (MHDLLHandle <> 0); 662 end; 663 607 664 { Form Events (Create, Destroy) ----------------------------------------------------------- } 608 665 … … 618 675 ClientVer, ServerVer, ServerReq: string; 619 676 begin 677 FProccessingNextClick := false; 620 678 FJustEnteredApp := false; 621 679 SizeHolder := TSizeHolder.Create; … … 801 859 GraphFloatActive := false; 802 860 GraphContext := ''; 861 frmGraphData := TfrmGraphData.Create(self); // form is only visible for testing 862 GraphDataOnUser; 803 863 uRemoteType := ''; 804 864 FPrevPtID := ''; … … 894 954 Screen.OnActiveFormChange := FOldActiveFormChange; 895 955 FNextButtonBitmap.Free; 956 if FNextButton <> nil then FNextButton.Free; 896 957 uTabList.Free; 897 958 FlaggedPTList.Free; … … 1014 1075 +' Division='+GetDivisionID; 1015 1076 1077 end; 1078 1079 procedure TfrmFrame.compAccessTabPageCaptionQuery(Sender: TObject; 1080 var Text: string); 1081 begin 1082 Text := GetTabText; 1016 1083 end; 1017 1084 … … 1041 1108 1042 1109 procedure TfrmFrame.FormClose(Sender: TObject; var Action: TCloseAction); 1043 //var1044 // i: Integer;1045 // UserTool: TMenuItem;1046 1110 begin 1047 1111 FClosing := TRUE; … … 1082 1146 frmLabs.Close; //frmLabs.Release; 1083 1147 frmReports.Close; //frmReports.Release; 1148 frmGraphData.Close; //frmGraphData.Release; 1149 1084 1150 end; 1085 1151 // with mnuTools do for i := Count - 1 downto 0 do … … 1202 1268 if NewForm.Name = frmConsults.Name then frmConsults.Align := alClient 1203 1269 else frmConsults.Align := alNone; 1270 if NewForm.Name = frmReports.Name then frmReports.Align := alClient 1271 else frmReports.Align := alNone; 1204 1272 if NewForm.Name = frmDCSumm.Name then frmDCSumm.Align := alClient 1205 1273 else frmDCSumm.Align := alNone; … … 1208 1276 else frmSurgery.Align := alNone; 1209 1277 NewForm.BringToFront; // to cause tab switch to happen immediately 1210 1278 //CQ12232 NewForm.FocusFirstControl; 1211 1279 Application.ProcessMessages; 1212 1280 PostMessage(Handle, UM_SHOWPAGE, 0, 0); // this calls DisplayPage for the form … … 1224 1292 procedure TfrmFrame.tabPageChange(Sender: TObject); 1225 1293 { switches to form linked to NewTab } 1226 begin 1227 1294 var 1295 PageID : integer; 1296 begin 1297 PageID := TabToPageID((sender as TTabControl).TabIndex); 1298 if (PageID <> CT_NOPAGE) and (TabPage.CanFocus) and Assigned(FLastPage) and 1299 (not TabPage.Focused) then 1300 TabPage.SetFocus; //CQ: 14854 1228 1301 if (not User.IsReportsOnly) then 1229 1302 begin 1230 case TabToPageID((sender as TTabControl).TabIndex)of1303 case PageID of 1231 1304 CT_NOPAGE: SwitchToPage(nil); 1232 1305 CT_COVER: SwitchToPage(frmCover); … … 1244 1317 else // Reports Only tab. 1245 1318 SwitchToPage(frmReports); 1246 1319 if ScreenReaderSystemActive and FCtrlTabUsed then 1320 SpeakPatient; 1247 1321 end; 1248 1322 … … 1307 1381 lblPtName.Caption := Name; 1308 1382 lblPtSSN.Caption := SSN; 1309 lblPtAge.Caption := FormatFMDateTime('mmm dd,yyyy', DOB) + ' (' + IntToStr(Age) + ')'; 1383 // 1384 { TODO -oRV -cWVEHR Long Age : Change for long patient age. } 1385 lblPtAge.Caption := FormatFMDateTime('mmm dd,yyyy', DOB) + ' (' + GetPatientBriefAge(Patient.DFN) + ')'; 1386 //lblPtAge.Caption := FormatFMDateTime('mmm dd,yyyy', DOB) + ' (' + IntToStr(Age) + ')'; 1387 // 1310 1388 pnlPatient.Caption := lblPtName.Caption + ' ' + lblPtSSN.Caption + ' ' + lblPtAge.Caption; 1311 1389 if Length(CWAD) > 0 … … 1331 1409 begin 1332 1410 pnlFlag.Enabled := True; 1333 lblFlag.Font.Color := clMaroon;1411 lblFlag.Font.Color := Get508CompliantColor(clMaroon); 1334 1412 lblFlag.Enabled := True; 1335 1413 if (not FReFreshing) and (TriggerPRFPopUp(Patient.DFN)) then … … 1354 1432 Reason: string; 1355 1433 CCOWResponse: UserResponse; 1434 AccessStatus: integer; 1356 1435 1357 1436 procedure UpdatePatientInfoForAlert; … … 1371 1450 1372 1451 begin 1452 DoNotChangeEncWindow := False; 1453 mnuFile.Tag := 0; 1373 1454 SaveDFN := Patient.DFN; 1374 1455 Notifications.Next; … … 1381 1462 begin 1382 1463 // newdfn does not have new patient.co information for CCOW call 1383 if (AllowContextChangeAll(Reason)) then 1464 if ((Sender = mnuFileOpen) or (AllowContextChangeAll(Reason))) 1465 and AllowAccessToSensitivePatient(NewDFN, AccessStatus) then 1384 1466 begin 1385 1467 RemindersStarted := FALSE; … … 1421 1503 end else 1422 1504 begin 1423 Patient.DFN := SaveDFN; 1424 Notifications.Prior; 1425 Exit; 1505 if AccessStatus in [DGSR_ASK, DGSR_DENY] then 1506 begin 1507 Notifications.Clear; 1508 // hide the 'next notification' button 1509 FNextButtonActive := False; 1510 FNextButton.Free; 1511 FNextButton := nil; 1512 mnuFileNext.Enabled := False; 1513 mnuFileNotifRemove.Enabled := False; 1514 Patient.DFN := ''; 1515 mnuFileOpenClick(mnuFileNext); 1516 exit; 1517 end 1518 else 1519 if SaveDFN <> '' then 1520 begin 1521 Patient.DFN := SaveDFN; 1522 Notifications.Prior; 1523 Exit; 1524 end 1525 else 1526 begin 1527 Notifications.Clear; 1528 (* // hide the 'next notification' button 1529 FNextButtonActive := False; 1530 FNextButton.Free; 1531 FNextButton := nil; 1532 mnuFileNext.Enabled := False; 1533 mnuFileNotifRemove.Enabled := False;*) 1534 Patient.DFN := ''; 1535 mnuFileOpenClick(mnuFileNext); 1536 exit; 1537 end; 1426 1538 end; 1427 1539 end; … … 1485 1597 end; 1486 1598 NF_LAB_THRESHOLD_EXCEEDED : NextIndex := PageIDToTab(CT_LABS); 1599 NF_MAMMOGRAM_RESULTS : NextIndex := PageIDToTab(CT_REPORTS); 1600 NF_PAP_SMEAR_RESULTS : NextIndex := PageIDToTab(CT_REPORTS); 1601 NF_ANATOMIC_PATHOLOGY_RESULTS : NextIndex := PageIDToTab(CT_REPORTS); 1487 1602 NF_SURGERY_UNSIGNED_NOTE : if TabExists(CT_SURGERY) then 1488 1603 NextIndex := PageIDToTab(CT_SURGERY) … … 1498 1613 end; 1499 1614 1500 1501 1615 procedure TfrmFrame.SetBADxList; 1502 1616 var … … 1538 1652 begin 1539 1653 PtSelCancelled := FALSE; 1654 if not FRefreshing then mnuFile.Tag := 0 1655 else mnuFile.Tag := 1; 1540 1656 DetermineNextTab; 1541 1657 (* if (FRefreshing or User.UseLastTab) and (not FFirstLoad) then … … 1554 1670 PtEvtCompleted(TheCurrentView.EventDelay.PtEventIFN, TheCurrentView.EventDelay.EventName); 1555 1671 end;*) 1556 if not AllowContextChangeAll(Reason) then Exit; 1672 //if Sender <> mnuFileNext then //CQ 16273 & 16419 - Missing Review/Sign changes dialog when clicking 'Next' button 1673 if not AllowContextChangeAll(Reason) then Exit; 1557 1674 1558 1675 // update status text here … … 1613 1730 if PtSelCancelled then exit; 1614 1731 ShowEverything; 1732 //HideEverything('Retrieving information - please wait....'); //v27 (pending) RV 1615 1733 DisplayEncounterText; 1616 1734 FPrevInPatient := Patient.Inpatient; … … 1618 1736 begin 1619 1737 // display 'next notification' button 1738 SetUpNextButton; 1620 1739 FNextButtonActive := True; 1621 with stsArea.Panels[2] do1622 begin1623 //Text := 'Next ->';1624 Bevel := pbRaised;1625 end;1626 1740 mnuFileNext.Enabled := True; 1627 mnuFileNextClick( Self);1741 mnuFileNextClick(mnuFileOpen); 1628 1742 end 1629 1743 else … … 1631 1745 // hide the 'next notification' button 1632 1746 FNextButtonActive := False; 1633 with stsArea.Panels[2] do 1634 begin 1635 //Text := ''; 1636 Bevel := pbLowered; 1637 end; 1747 FNextButton.Free; 1748 FNextButton := nil; 1638 1749 mnuFileNext.Enabled := False; 1639 1750 mnuFileNotifRemove.Enabled := False; … … 1699 1810 if BILLING_AWARE then frmFrame.SetBADxList; //end IsBillingAware 1700 1811 {End BillingAware} 1812 //ShowEverything; //v27 (pending) RV 1813 if not FRefreshing then DoNotChangeEncWindow := false; 1701 1814 //frmCover.UpdateVAAButton; //VAA CQ7525 CQ#7933 - moved to SetupPatient, before event hook execution (RV) 1702 1815 end; … … 1715 1828 if NextTab = CT_NOPAGE then NextTab := User.InitialTab; 1716 1829 if User.IsReportsOnly then // Reports Only tab. 1717 NextTab := 0; // Only one tab should exist by this point in "REPORTS ONLY" mode.1830 NextTab := CT_REPORTS; // Only one tab should exist by this point in "REPORTS ONLY" mode. 1718 1831 if not TabExists(NextTab) then NextTab := CT_COVER; 1719 1832 if NextTab = CT_NOPAGE then NextTab := User.InitialTab; … … 1739 1852 NameNeedLook: string; 1740 1853 begin 1854 FReviewClick := True; 1855 mnuFile.Tag := 1; 1741 1856 EventChanges := False; 1742 1857 NameNeedLook := ''; … … 1757 1872 end 1758 1873 else InfoBox('No new changes to review/sign.', 'Review Changes', MB_OK); 1874 FOrderPrintForm := false; 1875 FReviewClick := false; 1759 1876 end; 1760 1877 … … 1777 1894 on EAccessViolation do 1778 1895 begin 1779 {$ifdef debug}Show Message('Access Violation in procedure TfrmFrame.mnuFileExitClick()');{$endif}1896 {$ifdef debug}Show508Message('Access Violation in procedure TfrmFrame.mnuFileExitClick()');{$endif} 1780 1897 raise; 1781 1898 end; 1782 1899 on E: Exception do 1783 1900 begin 1784 {$ifdef debug}Show Message('Unhandled exception in procedure TfrmFrame.mnuFileExitClick()');{$endif}1901 {$ifdef debug}Show508Message('Unhandled exception in procedure TfrmFrame.mnuFileExitClick()');{$endif} 1785 1902 raise; 1786 1903 end; … … 1856 1973 if Pos('ecs gui.exe',lowerCase(AFile))<1 then 1857 1974 begin 1858 ShowM essage('This is not a valid ECS application.');1975 ShowMsg('This is not a valid ECS application.'); 1859 1976 Result := True; 1860 1977 end else … … 1896 2013 if Pos('ecs gui.exe',lowerCase(AFile))<1 then 1897 2014 begin 1898 ShowM essage('This is not a valid ECS application.');2015 ShowMsg('This is not a valid ECS application.'); 1899 2016 Result := True; 1900 2017 end else … … 1933 2050 if FECSAuthUser then UpdateECSParameter(ECSAppend) 1934 2051 else begin 1935 ShowM essage('You don''t have permission to use ECS.');2052 ShowMsg('You don''t have permission to use ECS.'); 1936 2053 exit; 1937 2054 end; … … 2003 2120 end; 2004 2121 2005 procedure TfrmFrame.stsAreaMouseDown(Sender: TObject; Button: TMouseButton;2006 Shift: TShiftState; X, Y: Integer);2007 begin2008 if (FNextButtonActive) and (X > FNextButtonL) and (X < FNextButtonR) then2009 begin2010 stsArea.Panels[2].Bevel := pbLowered;2011 popAlerts.AutoPopup := TRUE;2012 end;2013 end;2014 2015 procedure TfrmFrame.stsAreaMouseUp(Sender: TObject; Button: TMouseButton;2016 Shift: TShiftState; X, Y: Integer);2017 begin2018 if FNextButtonActive then2019 begin2020 stsArea.Panels[2].Bevel := pbRaised;2021 popAlerts.AutoPopup := FALSE;2022 if (X > FNextButtonL) and (X < FNextButtonR) then2023 if Button = mbLeft then mnuFileNextClick(Self);2024 end;2025 end;2026 2027 procedure TfrmFrame.stsAreaDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel;2028 const Rect: TRect);2029 begin2030 if FNextButtonActive then with StatusBar.Canvas do2031 begin2032 Draw(Rect.Left + 2, Rect.Top, FNextButtonBitmap); { draw bitmap }2033 TextOut(Rect.Left + 20, Rect.Top + 2, 'Next'); { draw text to the right of the bitmap }2034 end;2035 end;2036 2037 2122 { Toolbar Methods (make panels act like buttons) ------------------------------------------- } 2038 2123 … … 2059 2144 end; 2060 2145 2061 procedure TfrmFrame.pnlVisitMouseDown(Sender: TObject; Button: TMouseButton;2062 Shift: TShiftState; X, Y: Integer);2063 { emulate a button press in the encounter panel }2064 begin2065 if User.IsReportsOnly then2066 exit;2067 pnlVisit.BevelOuter := bvLowered;2068 //with lblStLocation do SetBounds(Left+2, Top+2, Width, Height);2069 with lblPtLocation do SetBounds(Left+2, Top+2, Width, Height);2070 with lblPtProvider do SetBounds(Left+2, Top+2, Width, Height);2071 end;2072 2073 procedure TfrmFrame.pnlVisitMouseUp(Sender: TObject; Button: TMouseButton;2074 Shift: TShiftState; X, Y: Integer);2075 { emulate a button raising in the encounter panel and call Update Provider/Location }2076 begin2077 if User.IsReportsOnly then2078 exit;2079 pnlVisit.BevelOuter := bvRaised;2080 //with lblStLocation do SetBounds(Left-2, Top-2, Width, Height);2081 with lblPtLocation do SetBounds(Left-2, Top-2, Width, Height);2082 with lblPtProvider do SetBounds(Left-2, Top-2, Width, Height);2083 end;2084 2085 2146 procedure TfrmFrame.pnlPrimaryCareMouseDown(Sender: TObject; 2086 2147 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); … … 2122 2183 var 2123 2184 s1, s2, s3, s4, Dummy: integer; 2124 2125 2185 panelBottom, panelMedIn : integer; 2126 2186 … … 2140 2200 SetUserColumns(TControl(frmMeds.hdrMedsIn)); // still need conversion 2141 2201 SetUserColumns(TControl(frmMeds.hdrMedsOut)); 2202 SetUserBounds2(TemplateEditorSplitters, tmplEditorSplitterMiddle, 2203 tmplEditorSplitterProperties, tmplEditorSplitterMain, tmplEditorSplitterBoil); 2204 SetUserBounds2(TemplateEditorSplitters2, tmplEditorSplitterNotes, Dummy, Dummy, Dummy); 2142 2205 SetUserBounds2(ReminderTreeName, RemTreeDlgLeft, RemTreeDlgTop, RemTreeDlgWidth, RemTreeDlgHeight); 2143 2206 SetUserBounds2(RemDlgName, RemDlgLeft, RemDlgTop, RemDlgWidth, RemDlgHeight); … … 2209 2272 Add(StrUserColumns(frmMeds.hdrMedsIn)); 2210 2273 Add(StrUserColumns(frmMeds.hdrMedsOut)); 2274 Add(StrUserBounds2(TemplateEditorSplitters, tmplEditorSplitterMiddle, 2275 tmplEditorSplitterProperties, tmplEditorSplitterMain, tmplEditorSplitterBoil)); 2276 Add(StrUserBounds2(TemplateEditorSplitters2, tmplEditorSplitterNotes, 0, 0, 0)); 2211 2277 Add(StrUserBounds2(ReminderTreeName, RemTreeDlgLeft, RemTreeDlgTop, RemTreeDlgWidth, RemTreeDlgHeight)); 2212 2278 Add(StrUserBounds2(RemDlgName, RemDlgLeft, RemDlgTop, RemDlgWidth, RemDlgHeight)); … … 2274 2340 FNextButtonR := FNextButtonL + Panels[2].Width; 2275 2341 end; 2342 if Notifications.Active then SetUpNextButton; 2276 2343 lstCIRNLocations.Left := FNextButtonL - ScrollBarWidth - 100; 2277 2344 lstCIRNLocations.Width := ClientWidth - lstCIRNLocations.Left; 2345 //cq: 15641 2346 if frmFrame.FNextButtonActive then // keeps button alligned if cancel is pressed 2347 begin 2348 FNextButton.Left := FNextButtonL; 2349 FNextButton.Top := stsArea.Top; 2350 end; 2278 2351 Self.Repaint; 2279 2352 end; … … 2307 2380 with lblPtCWAD do Font.Size := NewFontSize; 2308 2381 with lblCIRN do Font.Size := NewFontSize; 2309 with lbl CIRNDatado Font.Size := NewFontSize;2382 with lblVistaWeb do Font.Size := NewFontSize; 2310 2383 with lstCIRNLocations do Font.Size := NewFontSize; 2311 2384 with tabPage do Font.Size := NewFontSize; … … 2313 2386 with laVAA2 do Font.Size := NewFontSize; //VAA 2314 2387 2388 frmFrameHeight := frmFrame.Height; 2389 pnlPatientSelectedHeight := pnlPatientSelected.Height; 2315 2390 tabPage.Height := MainFontHeight + TAB_VOFFSET; // resize tab selector 2316 2391 FitToolbar; // resize toolbar … … 2341 2416 end; 2342 2417 2343 //remove CWAD color if using high-contrast colors2344 if ColorToRGB(clWindowText) <> ColorToRGB(clBlack) then2345 begin2346 lblPtCWAD.Font.Color := clWindowText;2347 lblFlag.Font.Color := clWindowText;2348 end;2349 2350 2418 case (NewFontSize) of 2351 2419 8: mnu8pt.Checked := true; … … 2354 2422 14: mnu14pt1.Checked := true; 2355 2423 18: mnu18pt1.Checked := true; 2356 24: mnu24pt1.Checked := true;2357 2424 end; 2358 2425 … … 2378 2445 { resizes and repositions the panels & labels used in the toolbar } 2379 2446 const 2380 PATIENT_WIDTH = 29; 2447 { TODO -oRV -cWVEHR Long Age : Change to 40, to fit long age } 2448 //PATIENT_WIDTH = 29; 2449 PATIENT_WIDTH = 40; 2450 {} 2381 2451 VISIT_WIDTH = 36; 2382 2452 POSTING_WIDTH = 11.5; 2383 2453 FLAG_WIDTH = 5; 2384 CIRN_WIDTH = 7;2454 CIRN_WIDTH = 11; 2385 2455 MHV_WIDTH = 6; 2386 LINES_HIGH = 2; 2456 { TODO -oRV -cWVEHR Long Age : Change to 3 lines high, to fit long age } 2457 //LINES_HIGH = 2; 2458 LINES_HIGH = 3; 2459 {} 2387 2460 M_HORIZ = 4; 2388 2461 M_MIDDLE = 2; … … 2393 2466 //WidthNeeded: integer; 2394 2467 begin 2395 pnlToolbar.Height := (LINES_HIGH * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ; 2468 // 2469 { TODO -oRV -cWVEHR Long Age : Changed to fit long age } 2470 pnlToolbar.Height := (LINES_HIGH * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ + M_HORIZ; 2471 //pnlToolbar.Height := (LINES_HIGH * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ; 2472 // 2396 2473 pnlPatient.Width := HigherOf(PATIENT_WIDTH * MainFontWidth, lblPtName.Width + (M_WVERT * 2)); 2397 2474 lblPtSSN.Top := M_HORIZ + lblPtName.Height + M_MIDDLE; 2398 lblPtAge.Top := lblPtSSN.Top; 2399 lblPtAge.Left := pnlPatient.Width - lblPtAge.Width - M_WVERT; 2475 // 2476 { TODO -oRV -cWVEHR Long Age : Changed to fit long age } 2477 lblPtAge.Top := lblPtSSN.Top + lblPtSSN.Height + M_MIDDLE; 2478 lblPtAge.Left := lblPtSSN.Left; 2479 //lblPtAge.Top := lblPtSSN.Top; 2480 //lblPtAge.Left := pnlPatient.Width - lblPtAge.Width - M_WVERT; 2481 // 2400 2482 pnlVisit.Width := HigherOf(LowerOf(VISIT_WIDTH * MainFontWidth, 2401 2483 HigherOf(lblPtProvider.Width + (M_WVERT * 2), … … 2404 2486 lblPtProvider.Top := lblPtSSN.Top; 2405 2487 lblPtAttending.Top := lblPtSSN.Top; 2406 lblCIRNData.Top := lblPtSSN.Top;2407 2488 pnlPostings.Width := Round(POSTING_WIDTH * MainFontWidth); 2408 2489 pnlFlag.Width := Round(FLAG_WIDTH * MainFontWidth); 2409 2490 pnlFlag.Width := Round(FLAG_WIDTH * MainFontWidth); 2410 pnlCIRN.Width := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT; 2411 paVAA.Width := Round(MHV_WIDTH * MainFontWidth) + M_WVERT; 2491 pnlRemoteData.Width := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT; 2492 pnlVistaWeb.Height := pnlRemoteData.Height div 2; 2493 paVAA.Width := Round(MHV_WIDTH * MainFontWidth) + M_WVERT + 2; 2412 2494 with lblPtPostings do 2413 2495 SetBounds(M_WVERT, M_HORIZ, pnlPostings.Width-M_WVERT-M_WVERT, lblPtName.Height); … … 2452 2534 begin 2453 2535 if (frmRemDlg <> nil) then 2454 ShowM essage('Please close the reminder dialog before changing font sizes.')2536 ShowMsg('Please close the reminder dialog before changing font sizes.') 2455 2537 else 2456 2538 if (dlgProbs <> nil) then 2457 ShowM essage('Font size cannot be changed while adding or editing a problem.')2539 ShowMsg('Font size cannot be changed while adding or editing a problem.') 2458 2540 else 2459 2541 begin … … 2691 2773 ASite: TRemoteSite; 2692 2774 begin 2775 uUseVistaWeb := false; 2693 2776 with RemoteSites do 2694 if UseVistaWeb then 2695 begin 2696 ChangePatient(Patient.DFN); 2697 lblCIRN.Caption := 'Remote'; //VistaWeb On 2698 lblCIRNData.Caption := 'Data*'; 2699 pnlCIRN.Caption := 'Remote Data'; 2700 lblCIRN.Width := 43; 2701 lblCIRNData.Width := 43; 2702 lblCIRNData.Alignment := taCenter; 2703 lblCIRN.Alignment := taCenter; 2704 lblCIRN.Enabled := True; 2705 lblCIRNData.Enabled := True; 2706 lblCIRNAvail.Enabled := True; 2707 pnlCIRN.TabStop := True; 2708 if RemoteDataExists and (RemoteSites.Count > 0) then 2709 begin 2710 lblCIRN.Enabled := True; 2711 lblCIRNData.Enabled := True; 2712 lblCIRNAvail.Enabled := True; 2713 pnlCIRN.TabStop := True; 2714 if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then 2715 begin 2716 lblCIRN.Font.Color := clBlue; 2717 lblCIRNData.Font.Color := clBlue; 2718 lblCIRNAvail.Font.Color := clBlue; 2719 lstCIRNLocations.Font.Color := clBlue; 2720 lblCIRN.Caption := 'Remote'; 2721 lblCIRNData.Caption := 'Data*'; 2722 lblCIRNAvail.Caption := 'Available'; 2723 pnlCIRN.Caption := 'Remote Data Available'; 2724 end 2725 else 2726 begin 2727 lblCIRN.Font.Color := clWindowText; 2728 lblCIRNData.Font.Color := clWindowText; 2729 lblCIRNAvail.Font.Color := clWindowText; 2730 lstCIRNLocations.Font.Color := clWindowText; 2731 end; 2732 end 2733 else 2734 begin 2735 lblCIRN.Font.Color := clWindowText; 2736 lblCIRNData.Font.Color := clWindowText; 2737 lblCIRNAvail.Font.Color := clWindowText; 2738 lblCIRN.Enabled := False; 2739 lblCIRNData.Enabled := False; 2740 lblCIRNAvail.Enabled := False; 2741 pnlCIRN.TabStop := False; 2742 pnlCIRN.Hint := NoDataReason; 2743 end; 2744 pnlCIRN.Hint := 'Click to open VistaWeb'; 2745 end 2746 else 2747 begin 2748 ChangePatient(Patient.DFN); 2749 lblCIRN.Caption := ' Remote'; 2750 lblCIRNData.Caption := 'Data'; 2751 pnlCIRN.Caption := 'Remote Data'; 2752 lblCIRNAvail.Caption := ''; 2753 lblCIRN.Width := 43; 2754 lblCIRNData.Width := 43; 2755 lblCIRNData.Alignment := taCenter; 2756 lblCIRN.Alignment := taCenter; 2757 if RemoteDataExists and (RemoteSites.Count > 0) then 2758 begin 2759 lblCIRN.Enabled := True; 2760 lblCIRNData.Enabled := True; 2761 lblCIRNAvail.Enabled := True; 2762 pnlCIRN.TabStop := True; 2763 if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then 2764 begin 2765 lblCIRN.Font.Color := clBlue; 2766 lblCIRNData.Font.Color := clBlue; 2767 lblCIRNAvail.Font.Color := clBlue; 2768 lstCIRNLocations.Font.Color := clBlue; 2769 lblCIRN.Caption := 'Remote'; 2770 lblCIRNData.Caption := 'Data'; 2771 lblCIRNAvail.Caption := 'Available'; 2772 pnlCIRN.Caption := 'Remote Data Available'; 2773 end 2774 else 2775 begin 2776 lblCIRN.Font.Color := clWindowText; 2777 lblCIRNData.Font.Color := clWindowText; 2778 lblCIRNAvail.Font.Color := clWindowText; 2779 lstCIRNLocations.Font.Color := clWindowText; 2780 lblCIRNAvail.Color := clWindowText; 2781 end; 2782 pnlCIRN.Hint := 'Click to display other facilities having data for this patient.'; 2783 lstCIRNLocations.Items.Add('-1' + U + 'Use VistaWeb from now on'); 2784 if RemoteSites.Count > 0 then 2785 lstCIRNLocations.Items.Add('0' + U + 'All Available Sites'); 2786 for i := 0 to RemoteSites.Count - 1 do 2787 begin 2788 ASite := TRemoteSite(SiteList[i]); 2789 lstCIRNLocations.Items.Add(ASite.SiteID + U + ASite.SiteName + U + 2790 FormatFMDateTime('mmm dd yyyy hh:nn', ASite.LastDate)); 2791 end; 2792 end 2793 else 2794 begin 2795 lblCIRN.Font.Color := clWindowText; 2796 lblCIRNData.Font.Color := clWindowText; 2797 lblCIRNAvail.Font.Color := clWindowText; 2798 lblCIRN.Enabled := False; 2799 lblCIRNData.Enabled := False; 2800 lblCIRNAvail.Enabled := False; 2801 pnlCIRN.TabStop := False; 2802 pnlCIRN.Hint := NoDataReason; 2803 end; 2777 begin 2778 ChangePatient(Patient.DFN); 2779 lblCIRN.Caption := ' Remote Data'; 2780 lblCIRN.Alignment := taCenter; 2781 if RemoteDataExists and (RemoteSites.Count > 0) then 2782 begin 2783 lblCIRN.Enabled := True; 2784 pnlCIRN.TabStop := True; 2785 lblCIRN.Font.Color := Get508CompliantColor(clBlue); 2786 lstCIRNLocations.Font.Color := Get508CompliantColor(clBlue); 2787 lblCIRN.Caption := 'Remote Data'; 2788 pnlCIRN.Hint := 'Click to display other facilities having data for this patient.'; 2789 if RemoteSites.Count > 0 then 2790 lstCIRNLocations.Items.Add('0' + U + 'All Available Sites'); 2791 for i := 0 to RemoteSites.Count - 1 do 2792 begin 2793 ASite := TRemoteSite(SiteList[i]); 2794 lstCIRNLocations.Items.Add(ASite.SiteID + U + ASite.SiteName + U + 2795 FormatFMDateTime('mmm dd yyyy hh:nn', ASite.LastDate)); 2796 end; 2797 end 2798 else 2799 begin 2800 lblCIRN.Font.Color := clWindowText; 2801 lblCIRN.Enabled := False; 2802 pnlCIRN.TabStop := False; 2803 pnlCIRN.Hint := NoDataReason; 2804 end; 2804 2805 aAutoQuery := AutoRDV; //Check to see if Remote Queries should be used for all available sites 2805 2806 if (aAutoQuery = '1') and (lstCIRNLocations.Count > 0) then … … 2813 2814 2814 2815 procedure TfrmFrame.pnlCIRNClick(Sender: TObject); 2815 //var 2816 // aAddress: string; 2817 begin 2818 {if UseVistaWeb then 2819 begin 2820 pnlCIRN.BevelOuter := bvRaised; 2821 pnlCIRN.Hint := 'Click to open VistaWeb'; 2822 lblCIRN.Width := 43; 2823 lblCIRNData.Width := 43; 2824 lblCIRNData.Alignment := taCenter; 2825 lblCIRN.Alignment := taCenter; 2826 lstCIRNLocations.Visible := false; 2827 lstCIRNLocations.SendToBack; 2828 aAddress := GetVistaWebAddress(Patient.DFN); 2829 ShellExecute(Handle, 'open', PChar(aAddress), PChar(''), '', SW_NORMAL); 2830 Exit; 2831 end; 2832 if not RemoteSites.RemoteDataExists then Exit; 2833 if (not lstCIRNLocations.Visible) then 2834 begin 2835 pnlCIRN.BevelOuter := bvLowered; 2836 lstCIRNLocations.Visible := True; 2837 lstCIRNLocations.BringToFront; 2838 lstCIRNLocations.SetFocus; 2839 pnlCIRN.Hint := 'Click to close list.'; 2840 end 2841 else 2842 begin 2843 pnlCIRN.BevelOuter := bvRaised; 2844 lstCIRNLocations.Visible := False; 2845 lstCIRNLocations.SendToBack; 2846 pnlCIRN.Hint := 'Click to display other facilities having data for this patient.'; 2847 end } 2816 begin 2848 2817 ViewInfo(mnuViewRemoteData); 2849 2818 end; 2850 2819 2851 2820 procedure TfrmFrame.lstCIRNLocationsClick(Sender: TObject); 2852 const2853 DGSR_FAIL = -1;2854 DGSR_NONE = 0;2855 DGSR_SHOW = 1;2856 DGSR_ASK = 2;2857 DGSR_DENY = 3;2858 2821 var 2859 2822 iIndex,j,iAll,iCur: integer; … … 2864 2827 AccessStatus := 0; 2865 2828 iIndex := lstCIRNLocations.ItemIndex; 2866 if iIndex = 0 then2867 if (piece(lstCIRNLocations.Items[0],'^',1) = '-1') and (lstCIRNLocations.Checked[iIndex] = true) then2868 begin2869 if MessageDlg('Are you sure you want to make VistaWeb your default for viewing Remote Data?',2870 mtConfirmation, [mbYes, mbNo], 0) = mrYes then2871 begin2872 ChangeVistaWebParam('1');2873 lblCIRN.Caption := 'Remote'; //VistaWeb On2874 lblCIRNData.Caption := 'Data*';2875 pnlCIRN.Caption := 'Remote Data';2876 lblCIRNAvail.Caption := '';2877 lblCIRN.Width := 43;2878 lblCIRNData.Width := 43;2879 lblCIRNData.Alignment := taCenter;2880 lblCIRN.Alignment := taCenter;2881 with RemoteSites do if RemoteDataExists and (RemoteSites.Count > 0) then2882 begin2883 lblCIRN.Enabled := True;2884 lblCIRNData.Enabled := True;2885 pnlCIRN.TabStop := True;2886 if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then2887 begin2888 lblCIRN.Font.Color := clBlue;2889 lblCIRNData.Font.Color := clBlue;2890 lstCIRNLocations.Font.Color := clBlue;2891 lblCIRN.Caption := 'Remote';2892 lblCIRNData.Caption := 'Data*';2893 lblCIRNAvail.Caption := 'Available';2894 pnlCIRN.Caption := 'Remote Data Available';2895 end2896 else2897 begin2898 lblCIRN.Font.Color := clWindowText;2899 lblCIRNData.Font.Color := clWindowText;2900 lstCIRNLocations.Font.Color := clWindowText;2901 lblCIRNAvail.Font.Color := clWindowText;2902 end;2903 end;2904 pnlCIRNClick(self);2905 Exit;2906 end2907 else2908 lstCIRNLocations.Checked[iIndex] := false;2909 end2910 else2911 begin2912 ChangeVistaWebParam('0');2913 lblCIRN.Caption := 'Remote';2914 lblCIRNData.Caption := 'Data';2915 pnlCIRN.Caption := 'Remote Data';2916 lblCIRN.Width := 43;2917 lblCIRNData.Width := 43;2918 lblCIRNData.Alignment := taCenter;2919 lblCIRN.Alignment := taCenter;2920 pnlCIRNClick(self);2921 Exit;2922 end;2923 2829 if not CheckHL7TCPLink then 2924 2830 begin … … 2949 2855 with RemoteSites.SiteList do 2950 2856 for j := 0 to Count - 1 do 2951 if lstCIRNLocations.Checked[j+ 2] = true then2857 if lstCIRNLocations.Checked[j+1] = true then 2952 2858 begin 2953 lstCIRNLocations.Checked[j+ 2] := false;2859 lstCIRNLocations.Checked[j+1] := false; 2954 2860 TRemoteSite(RemoteSites.SiteList[j]).Selected := false; 2955 2861 TRemoteSite(RemoteSites.SiteList[j]).ReportClear; … … 2967 2873 Screen.Cursor := crDefault; 2968 2874 aMsg := aMsg + ' at site: ' + TRemoteSite(Items[j]).SiteName; 2969 s := lstCIRNLocations.Items[j+ 2];2970 lstCIRNLocations.Items[j+ 2] := pieces(s, '^', 1, 3);2875 s := lstCIRNLocations.Items[j+1]; 2876 lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3); 2971 2877 case AccessStatus of 2972 2878 DGSR_FAIL: begin 2973 2879 if piece(aMsg,':',1) = 'RPC name not found at site' then //Allow for backward compatibility 2974 2880 begin 2975 lstCIRNLocations.Checked[j+ 2] := true;2881 lstCIRNLocations.Checked[j+1] := true; 2976 2882 TRemoteSite(RemoteSites.SiteList[j]).ReportClear; 2977 2883 TRemoteSite(RemoteSites.SiteList[j]).LabClear; … … 2981 2887 begin 2982 2888 InfoBox(aMsg, TC_DGSR_ERR, MB_OK); 2983 lstCIRNLocations.Checked[j+ 2] := false;2984 lstCIRNLocations.Items[j+ 2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_ERR;2889 lstCIRNLocations.Checked[j+1] := false; 2890 lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_ERR; 2985 2891 TRemoteSite(Items[j]).Selected := false; 2986 2892 Continue; … … 2988 2894 end; 2989 2895 DGSR_NONE: begin 2990 lstCIRNLocations.Checked[j+ 2] := true;2896 lstCIRNLocations.Checked[j+1] := true; 2991 2897 TRemoteSite(RemoteSites.SiteList[j]).ReportClear; 2992 2898 TRemoteSite(RemoteSites.SiteList[j]).LabClear; … … 2995 2901 DGSR_SHOW: begin 2996 2902 InfoBox(AMsg, TC_DGSR_SHOW, MB_OK); 2997 lstCIRNLocations.Checked[j+ 2] := true;2903 lstCIRNLocations.Checked[j+1] := true; 2998 2904 TRemoteSite(RemoteSites.SiteList[j]).ReportClear; 2999 2905 TRemoteSite(RemoteSites.SiteList[j]).LabClear; … … 3003 2909 MB_DEFBUTTON2) = IDYES then 3004 2910 begin 3005 lstCIRNLocations.Checked[j+ 2] := true;2911 lstCIRNLocations.Checked[j+1] := true; 3006 2912 TRemoteSite(RemoteSites.SiteList[j]).ReportClear; 3007 2913 TRemoteSite(RemoteSites.SiteList[j]).LabClear; … … 3010 2916 else 3011 2917 begin 3012 lstCIRNLocations.Checked[j+ 2] := false;3013 lstCIRNLocations.Items[j+ 2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_SHOW;2918 lstCIRNLocations.Checked[j+1] := false; 2919 lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_SHOW; 3014 2920 TRemoteSite(Items[j]).Selected := false; 3015 2921 Continue; … … 3017 2923 else begin 3018 2924 InfoBox(AMsg, TC_DGSR_DENY, MB_OK); 3019 lstCIRNLocations.Checked[j+ 2] := false;3020 lstCIRNLocations.Items[j+ 2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_DENY;2925 lstCIRNLocations.Checked[j+1] := false; 2926 lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_DENY; 3021 2927 TRemoteSite(Items[j]).Selected := false; 3022 2928 Continue; … … 3100 3006 end; 3101 3007 with frmLabs do 3102 if lstReports.ItemIndex > -1 then 3008 if piece(uRemoteType,'^',1) = '1' then 3009 if not(piece(uRemoteType,'^',2) = 'V') then 3010 begin 3011 TabControl1.Visible := true; 3012 pnlRightTop.Height := lblTitle.Height + TabControl1.Height; 3013 end; 3014 {if lstReports.ItemIndex > -1 then 3103 3015 if piece(lstReports.Items[lstReports.ItemIndex],'^',3) = '1' then 3104 3016 if not(piece(lstReports.Items[lstReports.ItemIndex],'^',5) = 'V') then 3105 TabControl1.Visible := true; 3017 TabControl1.Visible := true;} 3106 3018 end; 3107 3019 end; … … 3116 3028 TRemoteSite(Items[j])); 3117 3029 end; 3118 //frmLabs.TabControl1.OnChange(nil); 3119 //frmReports.TabControl1.OnChange(nil); 3030 3120 3031 if frmReports.tvReports.SelectionCount > 0 then frmReports.tvReportsClick(self); 3121 if frmLabs.lstReports.ItemIndex > -1 then frmLabs.ExtlstReportsClick(self, true); 3032 if frmLabs.tvReports.SelectionCount > 0 then frmLabs.tvReportsClick(self); 3033 //if frmLabs.lstReports.ItemIndex > -1 then frmLabs.ExtlstReportsClick(self, true); 3122 3034 StatusText(''); 3123 3035 end; … … 3234 3146 begin 3235 3147 LoadSizesForUser; 3236 // LoadUserVitalPreferences;3237 3148 GetUserTemplateDefaults(TRUE); 3238 3149 end; … … 3241 3152 begin 3242 3153 SaveSizesForUser; // position & size settings 3243 // SaveUserVitalPreferences; // save Vitals metric setting3244 3154 SaveUserTemplateDefaults; 3245 3155 end; … … 3248 3158 begin 3249 3159 FRefreshing := TRUE; 3160 3250 3161 try 3251 3162 mnuFileOpenClick(Self); … … 3260 3171 FOldActivate(Sender); 3261 3172 SetActiveWindow(Application.Handle); 3173 if ScreenReaderSystemActive and assigned(Patient) and (Patient.Name <> '') then 3174 SpeakTabAndPatient; 3262 3175 end; 3263 3176 … … 3283 3196 end; 3284 3197 3285 (*procedure TfrmFrame.CreateTab(var AnInstance: TObject; AClass: TClass; ATabID: integer; ALabel: string);3286 begin3287 AnInstance := TPage.Create(Self);3288 TPage(AnInstance).Parent := pnlPage;3289 TPage(AnInstance).Show;3290 uTabList.Add(IntToStr(ATabID));3291 tabPage.Tabs.Add(ALabel);3292 end;*)3293 3198 3294 3199 procedure TfrmFrame.CreateTab(ATabID: integer; ALabel: string); … … 3388 3293 3389 3294 // Top panel components: 3390 //pnlVisit.visible := false;3391 3295 pnlVisit.hint := 'Provider/Location'; 3392 3296 pnlVisit.onMouseDown := nil; 3393 3297 pnlVisit.onMouseUp := nil; 3394 //pnlPrimaryCare.visible := false;3395 //pnlPostings.visible := false;3396 //lblPtCWAD.visible := false;3397 //lblPtPostings.visible := false;3398 //pnlReminders.visible := false;3399 //anmtRemSearch.visible := false;3400 3298 3401 3299 // Forms for other tabs: … … 3426 3324 uCore.TempEncounterLoc := 0; //hds7591 Clinic/Ward movement. 3427 3325 uCore.TempEncounterLocName := ''; //hds7591 Clinic/Ward movement. 3428 3326 uCore.TempEncounterText := ''; 3327 uCore.TempEncounterDateTime := 0; 3328 uCore.TempEncounterVistCat := #0; 3329 //ucore.TempOutEncounterLoc := 0; 3330 //uCore.TempOutEncounterLocName := ''; 3331 if (not FRefreshing) and (FReviewClick = false) then DoNotChangeEncWindow := false; 3429 3332 if (FPrevInPatient and Patient.Inpatient) then //transfering inside hospital 3430 Encounter.Location := Patient.Location 3333 begin 3334 // if DoNotChangeEncWindow = false then 3335 // begin 3336 if FReviewClick = True then 3337 begin 3338 ucore.TempEncounterLoc := Encounter.Location; 3339 uCore.TempEncounterLocName := Encounter.LocationName; 3340 uCore.TempEncounterText := Encounter.LocationText; 3341 uCore.TempEncounterDateTime := Encounter.DateTime; 3342 uCore.TempEncounterVistCat := Encounter.VisitCategory; 3343 end 3344 else if (patient.Location <> encounter.Location) and (OrderPrintForm = false) then 3345 begin 3346 frmPrintLocation.SwitchEncounterLoction(Encounter.Location, Encounter.locationName, Encounter.LocationText, 3347 Encounter.DateTime, Encounter.VisitCategory); 3348 DisplayEncounterText; 3349 exit; 3350 end 3351 else if (patient.Location <> encounter.Location) and (OrderPrintForm = True) then 3352 begin 3353 OrderPrintForm := false; 3354 Exit; 3355 end; 3356 3357 //end; 3358 Encounter.Location := Patient.Location; 3359 // end; 3360 end 3431 3361 else if (FPrevInPatient and (not Patient.Inpatient)) then //patient was discharged 3432 3362 begin … … 3440 3370 uCore.TempEncounterLoc := Encounter.Location; //hds7591 Clinic/Ward movement. 3441 3371 uCore.TempEncounterLocName := Encounter.LocationName; //hds7591 Clinic/Ward movement. 3442 Encounter.Location := Patient.Location; 3443 Encounter.DateTime := Patient.AdmitTime; 3444 Encounter.VisitCategory := 'H'; 3372 uCore.TempEncounterText := Encounter.LocationText; 3373 uCore.TempEncounterDateTime := Encounter.DateTime; 3374 uCore.TempEncounterVistCat := Encounter.VisitCategory; 3375 if (FReviewClick = False) and (encounter.Location <> patient.Location) then 3376 frmPrintLocation.SwitchEncounterLoction(Encounter.Location, Encounter.locationName, Encounter.LocationText, 3377 Encounter.DateTime, Encounter.VisitCategory) 3378 else 3379 //if DoNotChangeEncWindow = false then 3380 begin 3381 Encounter.Location := Patient.Location; 3382 Encounter.DateTime := Patient.AdmitTime; 3383 Encounter.VisitCategory := 'H'; 3384 end; 3445 3385 FPrevInPatient := True; 3446 3386 end; … … 3453 3393 NewTabIndex: integer; 3454 3394 begin 3395 inherited; 3396 FCtrlTabUsed := FALSE; 3455 3397 //CQ2844: Toggle Remote Data button using Alt+R 3456 3398 case Key of … … 3459 3401 end; 3460 3402 3461 if (Key = VK_TAB) then begin 3462 if (ssCtrl in Shift) then begin 3403 if (Key = VK_TAB) then 3404 begin 3405 if (ssCtrl in Shift) then 3406 begin 3407 FCtrlTabUsed := TRUE; 3463 3408 if not (ActiveControl is TCustomMemo) or not TMemo(ActiveControl).WantTabs then begin 3464 3409 NewTabIndex := tabPage.TabIndex; … … 3518 3463 procedure TfrmFrame.pnlPatientClick(Sender: TObject); 3519 3464 begin 3465 pnlPatient.Enabled := false; 3520 3466 ViewInfo(mnuViewDemo); 3467 pnlPatient.Enabled := true; 3521 3468 end; 3522 3469 3523 3470 procedure TfrmFrame.pnlVisitClick(Sender: TObject); 3524 3471 begin 3525 //if (not User.IsReportsOnly) then // Reports Only tab. 3526 // mnuFileEncounterClick(Self); 3472 pnlVisit.Enabled := false; 3473 pnlVisit.BevelOuter := bvLowered; 3474 with lblPtLocation do SetBounds(Left+2, Top+2, Width, Height); 3475 with lblPtProvider do SetBounds(Left+2, Top+2, Width, Height); 3476 3527 3477 ViewInfo(mnuViewVisits); 3478 3479 pnlVisit.BevelOuter := bvRaised; 3480 with lblPtLocation do SetBounds(Left-2, Top-2, Width, Height); 3481 with lblPtProvider do SetBounds(Left-2, Top-2, Width, Height); 3482 pnlVisit.Enabled := true; 3483 end; 3484 3485 procedure TfrmFrame.pnlVistaWebClick(Sender: TObject); 3486 begin 3487 inherited; 3488 uUseVistaWeb := true; 3489 pnlCIRNClick(self); 3490 uUseVistaWeb := false; 3491 end; 3492 3493 procedure TfrmFrame.pnlVistaWebMouseDown(Sender: TObject; Button: TMouseButton; 3494 Shift: TShiftState; X, Y: Integer); 3495 begin 3496 inherited; 3497 pnlVistaWeb.BevelOuter := bvLowered; 3498 end; 3499 3500 procedure TfrmFrame.pnlVistaWebMouseUp(Sender: TObject; Button: TMouseButton; 3501 Shift: TShiftState; X, Y: Integer); 3502 begin 3503 inherited; 3504 pnlVistaWeb.BevelOuter := bvRaised; 3528 3505 end; 3529 3506 … … 3551 3528 begin 3552 3529 {$ifdef DEBUG} 3553 Show Message(AMessage);3530 Show508Message(AMessage); 3554 3531 {$endif} 3555 3532 InfoBox(TX_CCOW_ERROR, TC_CCOW_ERROR, MB_ICONERROR or MB_OK); … … 3649 3626 begin 3650 3627 // New context is committed. 3651 //Show Message('Response was Commit');3628 //Show508Message('Response was Commit'); 3652 3629 mnuFileResumeContext.Enabled := False; 3653 3630 mnuFileBreakContext.Enabled := True; … … 3692 3669 except 3693 3670 on exc : EOleException do 3694 //Show Message('EOleException: ' + exc.Message + ' - ' + string(exc.ErrorCode) );3695 ShowM essage('EOleException: ' + exc.Message);3671 //Show508Message('EOleException: ' + exc.Message + ' - ' + string(exc.ErrorCode) ); 3672 ShowMsg('EOleException: ' + exc.Message); 3696 3673 end; 3697 3674 end; … … 3754 3731 Sleep(12000) 3755 3732 else if Length(Reason) > 0 then 3756 ctxContextor.SetSurveyResponse(Reason); 3733 ctxContextor.SetSurveyResponse(Reason) 3734 else 3735 begin 3736 imgCCOW.Picture.BitMap.LoadFromResourceName(hInstance, 'BMP_CCOW_LINKED'); 3737 pnlCCOW.Hint := TX_CCOW_LINKED; 3738 end; 3757 3739 FCCOWContextChanging := False; 3758 3740 end; … … 3788 3770 end; 3789 3771 if not PtChanged then exit; 3772 // HideEverything('Retrieving information - please wait....'); // v27 (pending) RV 3790 3773 FCCOWDrivedChange := True; 3791 3774 i := 0; … … 3804 3787 pnlCCOW.Hint := TX_CCOW_LINKED; 3805 3788 imgCCOW.Picture.BitMap.LoadFromResourceName(hInstance, FCCOWIconName); 3789 // ShowEverything; // v27 (pending) RV 3806 3790 end; 3807 3791 … … 3870 3854 begin 3871 3855 if not FCCOWInstalled then exit; 3856 DoNotChangeEncWindow := false; 3872 3857 //PtDFN := FindBestCCOWDFN(PtName); 3873 3858 PtDFN := FindBestCCOWDFN; … … 3940 3925 if FCCOWError then exit; 3941 3926 UpdateCCOWContext; 3942 FCCOWIconName := 'BMP_CCOW_LINKED'; 3943 pnlCCOW.Hint := TX_CCOW_LINKED; 3944 imgCCOW.Picture.BitMap.LoadFromResourceName(hInstance, FCCOWIconName); 3945 mnuFileResumeContext.Enabled := False; 3946 mnuFileBreakContext.Visible := True; 3947 mnuFileBreakContext.Enabled := True; 3927 if not FNoPatientSelected then 3928 begin 3929 FCCOWIconName := 'BMP_CCOW_LINKED'; 3930 pnlCCOW.Hint := TX_CCOW_LINKED; 3931 imgCCOW.Picture.BitMap.LoadFromResourceName(hInstance, FCCOWIconName); 3932 mnuFileResumeContext.Enabled := False; 3933 mnuFileBreakContext.Visible := True; 3934 mnuFileBreakContext.Enabled := True; 3935 end; 3948 3936 end; 3949 3937 … … 4052 4040 end; 4053 4041 4054 procedure TfrmFrame.HideEverything ;4042 procedure TfrmFrame.HideEverything(AMessage: string = 'No patient is currently selected.'); 4055 4043 begin 4056 4044 FNoPatientSelected := TRUE; 4045 pnlNoPatientSelected.Caption := AMessage; 4057 4046 pnlNoPatientSelected.Visible := True; 4058 4047 pnlNoPatientSelected.BringToFront; … … 4071 4060 mnuView.Enabled := False; 4072 4061 mnuTools.Enabled := False; 4062 if FNextButtonActive then FNextButton.Visible := False; 4073 4063 end; 4074 4064 … … 4076 4066 begin 4077 4067 FNoPatientSelected := FALSE; 4068 pnlNoPatientSelected.Caption := ''; 4078 4069 pnlNoPatientSelected.Visible := False; 4079 4070 pnlNoPatientSelected.SendToBack; … … 4101 4092 mnuView.Enabled := True; 4102 4093 mnuTools.Enabled := True; 4094 if FNextButtonActive then FNextButton.Visible := True; 4103 4095 end; 4104 4096 … … 4261 4253 begin 4262 4254 if btnClose.Tag = 1 then 4263 Exit; 4255 begin 4256 Screen.Cursor := crDefault; 4257 exit; 4258 end; 4264 4259 Initialize; 4265 4260 Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name); … … 4282 4277 end; 4283 4278 end 4284 else if GraphFloat.btnClose.Tag = 1 then4285 Exit4286 else if GraphFloatActive and (GraphFloat.lstTypes.Hint = Patient.DFN) then4287 GraphFloat.BringToFront // graph is active, same patient4288 else if GraphFloat.lstTypes.Hint = Patient.DFN then4289 begin // graph is not active, same patient4290 // context sensitive4291 GraphFloat.Show;4292 GraphFloatActive := true;4293 end4294 4279 else 4295 //with GraphFloat do // new patient 4296 begin 4297 GraphFloat.InitialRetain; 4298 GraphFloatActive := false; 4299 GraphFloat.Free; 4300 GraphFloat := nil; 4301 mnuToolsGraphingClick(self); // delete and recurse 4302 {//FormCreate(self); //**************** 4303 Initialize; 4304 DisplayData('top'); 4305 DisplayData('bottom'); 4306 lstCheck.Items.Clear; 4307 Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name); 4308 // context sensitive 4309 Show; 4310 GraphFloatActive := true;} 4280 begin 4281 GraphFloat.Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name); 4282 if GraphFloat.btnClose.Tag = 1 then 4283 begin 4284 Screen.Cursor := crDefault; 4285 exit; 4286 end 4287 else if GraphFloatActive and (frmGraphData.pnlData.Hint = Patient.DFN) then 4288 GraphFloat.BringToFront // graph is active, same patient 4289 else if frmGraphData.pnlData.Hint = Patient.DFN then 4290 begin // graph is not active, same patient 4291 // context sensitive 4292 GraphFloat.Show; 4293 GraphFloatActive := true; 4294 end 4295 else 4296 //with GraphFloat do // new patient 4297 begin 4298 GraphFloat.InitialRetain; 4299 GraphFloatActive := false; 4300 GraphFloat.Free; 4301 GraphFloat := nil; 4302 mnuToolsGraphingClick(self); // delete and recurse 4303 {//FormCreate(self); //**************** 4304 Initialize; 4305 DisplayData('top'); 4306 DisplayData('bottom'); 4307 GtslCheck.Clear; 4308 Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name); 4309 // context sensitive 4310 Show; 4311 GraphFloatActive := true;} 4312 end; 4311 4313 end; 4312 4314 Screen.Cursor := crDefault; … … 4354 4356 ReportString: TStringList; 4355 4357 aAddress: string; 4358 4356 4359 begin 4357 4360 case (Sender as TMenuItem).Tag of … … 4378 4381 if fCover.VAAFlag[0] <> '0' then //'0' means subscriber not found 4379 4382 begin 4380 InsuranceSubscriberName := fCover.VAAFlag[12]; 4383 // CQ:15534-GE Remove leading spaces from Patient Name 4384 InsuranceSubscriberName := ( (Piece(fCover.VAAFlag[12],':',1)) + ': ' + 4385 (TRIM(Piece(fCover.VAAFlag[12],':',2)) ));//fCover.VAAFlag[12]; 4381 4386 ReportString := VAAFlag; 4382 4387 ReportString[0] := ''; … … 4388 4393 end; 4389 4394 7:begin 4390 if UseVistaWebthen4395 if uUseVistaWeb = true then 4391 4396 begin 4392 4397 pnlCIRN.BevelOuter := bvRaised; 4393 pnlCIRN.Hint := 'Click to open VistaWeb';4394 lblCIRN.Width := 43;4395 lblCIRNData.Width := 43;4396 lblCIRNData.Alignment := taCenter;4397 4398 lblCIRN.Alignment := taCenter; 4398 4399 lstCIRNLocations.Visible := false; … … 4441 4442 end; 4442 4443 4444 procedure TfrmFrame.SetActiveTab(PageID: Integer); 4445 begin 4446 tabPage.TabIndex := frmFrame.PageIDToTab(PageID); 4447 tabPageChange(tabPage); 4448 end; 4449 4450 procedure TfrmFrame.NextButtonClick(Sender: TObject); 4451 begin 4452 if FProccessingNextClick then Exit; 4453 FProccessingNextClick := true; 4454 popAlerts.AutoPopup := TRUE; 4455 mnuFileNext.Enabled := True; 4456 mnuFileNextClick(Self); 4457 FProccessingNextClick := false; 4458 end; 4459 4460 procedure TfrmFrame.NextButtonMouseDown(Sender: TObject; Button: TMouseButton; 4461 Shift: TShiftState; X, Y: Integer); 4462 begin 4463 popAlerts.AutoPopup := TRUE; 4464 end; 4465 4466 procedure TfrmFrame.SetUpNextButton; 4467 begin 4468 if FNextButton <> nil then 4469 begin 4470 FNextButton.free; 4471 FNextButton := nil; 4472 end; 4473 FNextButton := TBitBtn.Create(self); 4474 FNextButton.Parent:= frmFrame; 4475 FNextButton.Glyph := FNextButtonBitmap; 4476 FNextButton.OnMouseDown := NextButtonMouseDown; 4477 FNextButton.OnClick := NextButtonClick; 4478 FNextButton.Caption := '&Next'; 4479 FNextButton.PopupMenu := popAlerts; 4480 FNextButton.Top := stsArea.Top; 4481 FNextButton.Left := FNextButtonL; 4482 FNextButton.Height := stsArea.Height; 4483 FNextButton.Width := stsArea.Panels[2].Width; 4484 FNextButton.TabStop := True; 4485 FNextButton.TabOrder := 1; 4486 FNextButton.show; 4487 end; 4488 4443 4489 initialization 4490 SpecifyFormIsNotADialog(TfrmFrame); 4444 4491 4445 4492 finalization
Note:
See TracChangeset
for help on using the changeset viewer.