Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/fFrame.pas

    r459 r460  
    55{$OPTIMIZATION OFF}                              // REMOVE AFTER UNIT IS DEBUGGED
    66{$WARN SYMBOL_PLATFORM OFF}
     7{$DEFINE CCOWBROKER}
    78
    89{.$define debug}
     
    120121    mnuAlertRenew: TMenuItem;
    121122    AppEvents: TApplicationEvents;
     123    paVAA: TKeyClickPanel;
     124    mnuToolsGraphing: TMenuItem;
     125    laVAA2: TButton;
     126    laMHV: TButton;
     127    lblCIRNAvail: TLabel;
     128    mnuViewInformation: TMenuItem;
     129    mnuViewVisits: TMenuItem;
     130    mnuViewPrimaryCare: TMenuItem;
     131    mnuViewMyHealtheVet: TMenuItem;
     132    mnuInsurance: TMenuItem;
     133    mnuViewFlags: TMenuItem;
     134    mnuViewRemoteData: TMenuItem;
    122135    procedure tabPageChange(Sender: TObject);
    123136    procedure FormCreate(Sender: TObject);
     
    142155    procedure mnuHelpBrokerClick(Sender: TObject);
    143156    procedure mnuFileEncounterClick(Sender: TObject);
    144     procedure mnuViewDemoClick(Sender: TObject);
    145157    procedure mnuViewPostingsClick(Sender: TObject);
    146158    procedure mnuHelpAboutClick(Sender: TObject);
     
    171183    function FormHelp(Command: Word; Data: Integer;
    172184      var CallHelp: Boolean): Boolean;
    173     procedure mnuViewRemindersClick(Sender: TObject);
    174185    procedure pnlRemindersMouseDown(Sender: TObject; Button: TMouseButton;
    175186      Shift: TShiftState; X, Y: Integer);
     
    219230    procedure AppEventsActivate(Sender: TObject);
    220231    procedure ScreenActiveFormChange(Sender: TObject);
     232    procedure AppEventsShortCut(var Msg: TWMKey; var Handled: Boolean);
    221233    procedure mnuToolsClick(Sender: TObject);
     234    procedure mnuToolsGraphingClick(Sender: TObject);
     235    procedure pnlCIRNMouseDown(Sender: TObject; Button: TMouseButton;
     236      Shift: TShiftState; X, Y: Integer);
     237    procedure pnlCIRNMouseUp(Sender: TObject; Button: TMouseButton;
     238      Shift: TShiftState; X, Y: Integer);
     239    procedure laMHVClick(Sender: TObject);
     240    procedure laVAA2Click(Sender: TObject);
     241    procedure ViewInfo(Sender: TObject);
     242    procedure mnuViewInformationClick(Sender: TObject);
    222243  private
    223244    FJustEnteredApp : boolean;
     
    228249    FCCOWBusy: boolean;
    229250    FCCOWError: boolean;
     251    FNoPatientSelected: boolean;
    230252    FRefreshing: boolean;
    231253    FClosing: boolean;
     
    242264    FTabChanged: TNotifyEvent;
    243265    FOldActivate: TNotifyEvent;
     266    FOldActiveFormChange: TNotifyEvent;
    244267    FECSAuthUser: Boolean;
    245268    FFixedStatusWidth: integer;
     
    248271    FFlagList: TStringList;
    249272    FPrevPtID: string;
     273    FVitalsDLLActive: boolean;
     274    FGraphFloatActive: boolean;
     275    FGraphContext: string;
    250276    procedure RefreshFixedStatusWidth;
     277    procedure FocusApplicationTopForm;
    251278    procedure AppActivated(Sender: TObject);
    252279    procedure AppDeActivated(Sender: TObject);
     
    272299    procedure SetDebugMenu;
    273300    procedure SetupPatient(AFlaggedList : TStringList = nil);
    274     procedure SetUpCIRN;
     301    //procedure SetUpCIRN;
    275302    procedure RemindersChanged(Sender: TObject);
    276303    procedure ReportsOnlyDisplay;
     
    283310    procedure UpdateECSParameter(var CmdParameter: string);
    284311    function  ValidECSUser: boolean;
    285     function  AllowCCOWContextChange(NewDFN: string): boolean;
     312    procedure StartCCOWContextor;
     313    function  AllowCCOWContextChange(var CCOWResponse: UserResponse; NewDFN: string): boolean;
    286314    procedure UpdateCCOWContext;
    287315    procedure CheckHyperlinkResponse(aContextItemCollection: IDispatch; var HyperlinkReason: string);
    288316    procedure CheckForDifferentPatient(aContextItemCollection: IDispatch; var PtChanged: boolean);
     317{$IFDEF CCOWBROKER}
     318    procedure CheckForDifferentUser(aContextItemCollection: IDispatch; var UserChanged: boolean);
     319{$ENDIF}
    289320    procedure HideEverything;
    290321    procedure ShowEverything;
    291322    //function FindBestCCOWDFN(var APatientName: string): string;
    292     function  FindBestCCOWDFN: string;
     323    function FindBestCCOWDFN: string;
    293324    procedure HandleCCOWError(AMessage: string);
    294325  public
    295     EnduringPtSelSplitterPos: integer;
     326   EnduringPtSelSplitterPos: integer;
    296327    procedure SetBADxList;
    297328
     
    309340    property Closing:         Boolean read FClosing;
    310341    property OnTabChanged:    TNotifyEvent read FTabChanged write FTabChanged;
     342    property VitalsDLLActive: boolean read FVitalsDLLActive write FVitalsDLLActive;
     343    property GraphFloatActive: boolean read FGraphFloatActive write FGraphFloatActive;
     344    property GraphContext: string read FGraphContext write FGraphContext;
     345    procedure ToggleMenuItemChecked(Sender: TObject);
     346    procedure SetUpCIRN;
    311347  end;
    312348
     
    331367uses
    332368  ORNet, rCore, fPtSelMsg, fPtSel, fCover, fProbs, fMeds, fOrders, rOrders, fNotes, fConsults, fDCSumm,
    333   rMisc, Clipbrd, fLabs, fReports, fPtDemo, fEncnt, fPtCWAD, uCore, fAbout, fReview, fxBroker,
     369  rMisc, Clipbrd, fLabs, fReports, rReports, fPtDemo, fEncnt, fPtCWAD, uCore, fAbout, fReview, fxBroker,
    334370  fxLists, fxServer, ORSystem, fRptBox, fSplash, rODAllergy, uInit, fLabTests, fLabInfo,
    335371  uReminders, fReminderTree, ORClasses, fDeviceSelect, fDrawers, fReminderDialog, ShellAPI, rVitals,
    336   fOptions, rTemplates, fSurgery, rSurgery, uEventHooks, uSignItems, fDefaultEvent,rECS,
     372  fOptions, fGraphs, rTemplates, fSurgery, rSurgery, uEventHooks, uSignItems, fDefaultEvent,rECS,
    337373  fIconLegend, uOrders, fPtSelOptns, DateUtils, uSpell, uOrPtf, fPatientFlagMulti,
    338   fAlertForward, UBAGlobals, fBAOptionsDiagnoses,UBACore,fOrdersSign;
     374  fAlertForward, UBAGlobals, fBAOptionsDiagnoses, UBACore, fOrdersSign, uVitals, fOrdersRenew, uFormMonitor
     375  {$IFDEF CCOWBROKER}
     376  , CCOW_const
     377  {$ENDIF}
     378  ;
     379
     380var                                 //  RV 05/11/04
     381  IsRunExecuted: Boolean = FALSE;           //  RV 05/11/04
     382  GraphFloat: TfrmGraphs;
    339383
    340384const
     
    410454procedure TfrmFrame.TimeOutAction;
    411455begin
    412   Close;
     456  if frmFrame.VitalsDLLActive then
     457    CloseVitalsDLL()
     458  else
     459    Close;
    413460end;
    414461
     
    460507  FContextChanging := True;
    461508  Result := True;
    462   if COMObjectActive or SpellCheckInProgress then
     509  if COMObjectActive or SpellCheckInProgress or VitalsDLLActive then
    463510    begin
    464511      Reason := 'COM_OBJECT_ACTIVE';
     
    531578  HasFlag := False;
    532579  HidePatientSelectMessages;
     580  if (GraphFloat <> nil) and GraphFloatActive then
     581  with GraphFloat do
     582  begin
     583    Initialize;
     584    DisplayData('top');
     585    DisplayData('bottom');
     586    lstCheck.Items.Clear;
     587    Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name);
     588  end;
    533589end;
    534590
     
    564620  FJustEnteredApp := false;
    565621  SizeHolder := TSizeHolder.Create;
     622  FOldActiveFormChange := Screen.OnActiveFormChange;
    566623  Screen.OnActiveFormChange := ScreenActiveFormChange;
    567624  if not (ParamSearch('CCOW')='DISABLE') then
    568625    try
    569       ctxContextor := TContextorControl.Create(Self);
    570       with ctxContextor do
    571         begin
    572           OnPending := ctxContextorPending;
    573           OnCommitted := ctxContextorCommitted;
    574           OnCanceled := ctxContextorCanceled;
    575         end;
    576       FCCOWBusy := False;
    577       FCCOWInstalled := True;
    578       FCCOWDrivedChange := False;
     626      StartCCOWContextor;
    579627    except
     628      IsRunExecuted := False;
    580629      FCCOWInstalled := False;
    581630      pnlCCOW.Visible := False;
     
    585634  else
    586635    begin
     636      IsRunExecuted := False;
    587637      FCCOWInstalled := False;
    588638      pnlCCOW.Visible := False;
     
    603653  FCreateProgress := FCP_SERVER;
    604654
     655{$IFDEF CCOWBROKER}
     656  EnsureBroker;
     657  if ctxContextor <> nil then
     658  begin
     659    if ParamSearch('CCOW') = 'PATIENTONLY' then
     660      RPCBrokerV.Contextor := nil
     661    else
     662      RPCBrokerV.Contextor := ctxContextor;
     663  end
     664  else
     665    RPCBrokerV.Contextor := nil;
     666{$ENDIF}
     667
    605668  if not ConnectToServer(TX_OPTION) then
    606669  begin
     670    if Assigned(RPCBrokerV) then
     671      InfoBox(RPCBrokerV.RPCBError, 'Error', MB_OK or MB_ICONERROR);
    607672    Close;
    608673    Exit;
     674  end;
     675
     676  if ctxContextor <> nil then
     677  begin
     678    if not (ParamSearch('CCOW') = 'PATIENTONLY') then
     679      ctxContextor.NotificationFilter := ctxContextor.NotificationFilter + ';User';
    609680  end;
    610681
     
    616687  FOldActivate := Application.OnActivate;
    617688  Application.OnActivate := AppActivated;
    618   Application.OnDeactivate := AppDeActivated;
    619 
     689  Application.OnDeActivate := AppDeActivated;
     690 
    620691  // create initial core objects
    621692  FCreateProgress := FCP_OBJECTS;
     
    695766  HasFlag  := False;
    696767  FlagList := TStringList.Create;
    697   FPrevPtID := '';
    698768  // set up structures specific to the user
    699769  Caption := TX_IN_USE + MixedCase(User.Name) + '  (' + RPCBrokerV.Server + ')';
     
    729799  FCreateProgress := FCP_FINISH;
    730800  pnlReminders.Visible := InteractiveRemindersActive;
     801  GraphFloatActive := false;
     802  GraphContext := '';
    731803  uRemoteType := '';
     804  FPrevPtID := '';
    732805  SetUserTools;
    733806  EnduringPtSelSplitterPos := 0;
     
    736809  InitialOrderVariables;
    737810  PostMessage(Handle, UM_INITIATE, 0, 0);    // select patient after main form is created
    738 
    739811//  mnuFileOpenClick(Self);
    740812//  if Patient.DFN = '' then  //*DFN*
     
    744816//  end;
    745817//  if WindowState = wsMinimized then WindowState := wsNormal;
    746 end;
    747 
    748 procedure TfrmFrame.UMInitiate(var Message: TMessage);
    749 begin
    750   NotifyOtherApps(NAE_OPEN, IntToStr(User.DUZ));
    751 
    752   if FCCOWInstalled then      // Please see me re: changes here - Thanks - RV.
     818  SetFormMonitoring(true);
     819end;
     820
     821procedure TfrmFrame.StartCCOWContextor;
     822begin
    753823  try
    754     // To re-enable the multiple instance functionality, remove the '#' from the following line
    755     ctxContextor.Run('CPRSChart', '', TRUE, '*');
    756 
    757     // Uncomment the following line to run in secure binding mode, once the vault is configured to do so.
    758     //   Also comment out the 'ctxContextor.Run' line above.
    759     //ctxContextor.Run('CPRSChart', PASSCODE, TRUE, '*');
     824    ctxContextor := TContextorControl.Create(Self);
     825    with ctxContextor do
     826      begin
     827        OnPending := ctxContextorPending;
     828        OnCommitted := ctxContextorCommitted;
     829        OnCanceled := ctxContextorCanceled;
     830      end;
     831    FCCOWBusy := False;
     832    FCCOWInstalled := True;
     833    FCCOWDrivedChange := False;
     834    ctxContextor.Run('CPRSChart', '', TRUE, 'Patient');
     835    IsRunExecuted := True;
    760836  except
    761837    on exc : EOleException do
    762       begin
    763         try
    764           // Uncomment the following line to run in secure binding mode, once the vault is configured to do so.
    765           ctxContextor.Run('CPRSChart' + '#', '', TRUE, '*');
    766           //ctxContextor.Run('CPRSChart' + '#', PASSCODE, TRUE, '*');
    767 
    768           if ParamSearch('CCOW') = 'FORCE' then
     838    begin
     839      IsRunExecuted := False;
     840      FreeAndNil(ctxContextor);
     841      try
     842        ctxContextor := TContextorControl.Create(Self);
     843        with ctxContextor do
    769844          begin
    770             mnuFileResumeContext.Enabled := False;
    771             mnuFileBreakContext.Visible := True;
    772             mnuFileBreakContext.Enabled := True;
    773           end
    774           else
    775           begin
    776             ctxContextor.Suspend;
    777             mnuFileResumeContext.Visible := True;
    778             mnuFileBreakContext.Visible := True;
    779             mnuFileBreakContext.Enabled := False;
     845            OnPending := ctxContextorPending;
     846            OnCommitted := ctxContextorCommitted;
     847            OnCanceled := ctxContextorCanceled;
    780848          end;
    781         except
    782           on exc : EOleException do
    783             begin
    784               FCCOWInstalled := False;
    785               pnlCCOW.Visible := False;
    786               mnuFileResumeContext.Visible := False;
    787               mnuFileBreakContext.Visible := False;
    788             end;
     849        FCCOWBusy := False;
     850        FCCOWInstalled := True;
     851        FCCOWDrivedChange := False;
     852        ctxContextor.Run('CPRSChart' + '#', '', TRUE, 'Patient');
     853        IsRunExecuted := True;
     854        if ParamSearch('CCOW') = 'FORCE' then
     855        begin
     856          mnuFileResumeContext.Enabled := False;
     857          mnuFileBreakContext.Visible := True;
     858          mnuFileBreakContext.Enabled := True;
     859        end
     860        else
     861        begin
     862          ctxContextor.Suspend;
     863          mnuFileResumeContext.Visible := True;
     864          mnuFileBreakContext.Visible := True;
     865          mnuFileBreakContext.Enabled := False;
    789866        end;
    790       end;   // on exc
    791   end;  // try/except
    792 
     867      except
     868        IsRunExecuted := False;
     869        FCCOWInstalled := False;
     870        FreeAndNil(ctxContextor);
     871        pnlCCOW.Visible := False;
     872        mnuFileResumeContext.Visible := False;
     873        mnuFileBreakContext.Visible := False;
     874      end;
     875    end;
     876  end
     877end;
     878
     879procedure TfrmFrame.UMInitiate(var Message: TMessage);
     880begin
     881  NotifyOtherApps(NAE_OPEN, IntToStr(User.DUZ));
    793882  LoadUserPreferences;
    794   GetBAStatus(User.DUZ,Encounter.Location);
     883  GetBAStatus(User.DUZ,Patient.DFN);
    795884  mnuFileOpenClick(Self);
    796885  Enabled := True;
     
    803892begin
    804893  Application.OnActivate := FOldActivate;
     894  Screen.OnActiveFormChange := FOldActiveFormChange;
    805895  FNextButtonBitmap.Free;
    806896  uTabList.Free;
     
    814904  User.Free;
    815905  SizeHolder.Free;
     906  ctxContextor.Free;
    816907end;
    817908
     
    833924
    834925procedure TfrmFrame.SetUserTools;
    835 const
    836   TX_M_NOT_CONFIG = 'Tools/Options menu on M side not configured properly -'+
    837                     ' please notify your IRM support immediately';
    838   TC_M_NOT_CONFIG = 'Warning: Check Tools/Options Menu in M';
    839926var
    840927  ToolItems: TToolItemList;
     
    885972    UserTool.Hint := Action;
    886973    UserTool.OnClick := ToolClick;
    887     if i < mnuTools.Count then
    888       mnuTools.Insert(i, UserTool)
    889     else
    890     begin
    891       mnuTools.Add(UserTool);
    892       InfoBox(TX_M_NOT_CONFIG, TC_M_NOT_CONFIG, MB_ICONWARNING or MB_OK)
    893     end;
     974    mnuTools.Insert(i, UserTool);
    894975  end;
    895976end;
     
    9651046begin
    9661047  FClosing := TRUE;
     1048  SetFormMonitoring(false);
    9671049  if FCreateProgress < FCP_FINISH then FTerminate := True;
    9681050
     
    9701052  if FCreateProgress = FCP_FINISH then NotifyOtherApps(NAE_CLOSE, '');
    9711053  TerminateOtherAppNotification;
     1054
     1055  if GraphFloat <> nil then
     1056  begin
     1057    if frmFrame.GraphFloatActive then
     1058      GraphFloat.Close;
     1059    GraphFloat.Release;
     1060  end;
    9721061
    9731062  // unhook the timeout hooks
     
    9761065  if FCreateProgress = FCP_FINISH then Changes.Clear;
    9771066  // clear server side flag global tmp
    978   ClearFlag;
     1067  if FCreateProgress = FCP_FINISH then ClearFlag;
    9791068  // save user preferences
    9801069  if FCreateProgress = FCP_FINISH then SaveUserPreferences;
     
    10051094  //Application.ProcessMessages;  // so everything finishes closing
    10061095  // if < FCP_FINISH we came here from inside FormCreate, so need to call terminate
     1096  //if GraphFloat <> nil then GraphFloat.Release;
    10071097  if FCreateProgress < FCP_FINISH then Application.Terminate;
    10081098end;
     
    12341324      NotifyOtherApps(NAE_NEWPT, SSN + U + FloatToStr(DOB) + U + Name);
    12351325    SelectMsg := '';
    1236     if (not FRefreshing) then
    1237     begin
    1238       if not Assigned(AFlaggedList) then ShowFlags
    1239       else if (AFlaggedList.IndexOf(Patient.DFN) < 0) then ShowFlags;
    1240     end;
    12411326    if MeansTestRequired(Patient.DFN, AMsg) then SelectMsg := AMsg;
    12421327    if HasLegacyData(Patient.DFN, AMsg)     then SelectMsg := SelectMsg + CRLF + AMsg;
     1328
    12431329    HasActiveFlg(FlagList, HasFlag, Patient.DFN);
    1244     if FPrevPtID <> patient.DFN then
    1245     begin
    1246       if HasFlag then
    1247       begin
    1248         pnlFlag.Enabled := True;
    1249         lblFlag.Font.Color := clMaroon;
    1250         lblFlag.Enabled := True;
    1251         if not FReFreshing then
    1252           ShowFlags;
    1253       end else
    1254       begin
    1255         pnlFlag.Enabled := False;
    1256         lblFlag.Font.Color := clBtnFace;
    1257         lblFlag.Enabled := False;
    1258       end;
    1259       FPrevPtID := patient.DFN;
     1330    if HasFlag then
     1331    begin
     1332      pnlFlag.Enabled := True;
     1333      lblFlag.Font.Color := clMaroon;
     1334      lblFlag.Enabled := True;
     1335      if (not FReFreshing) and (TriggerPRFPopUp(Patient.DFN)) then
     1336        ShowFlags;
     1337    end else
     1338    begin
     1339      pnlFlag.Enabled := False;
     1340      lblFlag.Font.Color := clBtnFace;
     1341      lblFlag.Enabled := False;
    12601342    end;
    1261 
     1343    FPrevPtID := patient.DFN;
     1344    frmCover.UpdateVAAButton; //VAA CQ7525  (moved here in v26.30 (RV))
    12621345    ProcessPatientChangeEventHook;
    12631346    if Length(SelectMsg) > 0 then ShowPatientSelectMessages(SelectMsg);
     
    12701353  NextIndex: Integer;
    12711354  Reason: string;
     1355  CCOWResponse: UserResponse;
    12721356begin
    12731357  SaveDFN := Patient.DFN;
     
    12931377         HasActiveFlg(FlagList, HasFlag, NewDFN);
    12941378        end;
    1295         if (FCCOWInstalled and (ctxContextor.State = csSuspended)) or (AllowCCOWContextChange(Patient.DFN)) then
     1379        if (FCCOWInstalled and (ctxContextor.State = csSuspended)) or (AllowCCOWContextChange(CCOWResponse, Patient.DFN)) then
    12961380          begin
    12971381            if Patient.Inpatient then
     
    13331417    mnuFileNotifRemove.Enabled := Notifications.Followup in [NF_FLAGGED_ORDERS,
    13341418                                                             NF_ORDER_REQUIRES_ELEC_SIGNATURE,
    1335                                                              NF_MEDICATIONS_EXPIRING,
     1419                                                             NF_MEDICATIONS_EXPIRING_INPT,
     1420                                                             NF_MEDICATIONS_EXPIRING_OUTPT,
    13361421                                                             NF_UNVERIFIED_MEDICATION_ORDER,
    13371422                                                             NF_UNVERIFIED_ORDER,
     
    13611446        NextIndex := PageIDToTab(CT_REPORTS);
    13621447    NF_DNR_EXPIRING                  : NextIndex := PageIDToTab(CT_ORDERS);
    1363     NF_MEDICATIONS_EXPIRING          : NextIndex := PageIDToTab(CT_ORDERS);
     1448    NF_MEDICATIONS_EXPIRING_INPT     : NextIndex := PageIDToTab(CT_ORDERS);
     1449    NF_MEDICATIONS_EXPIRING_OUTPT    : NextIndex := PageIDToTab(CT_ORDERS);
    13641450    NF_UNVERIFIED_MEDICATION_ORDER   : NextIndex := PageIDToTab(CT_ORDERS);
    13651451    NF_NEW_ORDER                     : NextIndex := PageIDToTab(CT_ORDERS);
     
    14311517  SaveDFN, Reason: string;
    14321518  //NextTab: Integer;     // moved up for visibility - v23.4  rV
    1433   ok, OldRemindersStarted: boolean;
     1519  ok, OldRemindersStarted, PtSelCancelled: boolean;
    14341520  //i: smallint;
    1435 begin
     1521  CCOWResponse: UserResponse;
     1522begin
     1523  PtSelCancelled := FALSE;
    14361524  DetermineNextTab;
    14371525(*  if (FRefreshing or User.UseLastTab) and (not FFirstLoad) then
     
    14711559  end;
    14721560
    1473   SaveDFN := Patient.DFN;
     1561  if FNoPatientSelected then
     1562    SaveDFN := ''
     1563  else
     1564    SaveDFN := Patient.DFN;
     1565   
    14741566  OldRemindersStarted := RemindersStarted;
    14751567  RemindersStarted := FALSE;
     
    15021594          end;
    15031595        if (Patient.DFN = '') or (Sender = mnuFileOpen) or (Sender = mnuFileNext) or (Sender = mnuViewDemo) then
    1504           SelectPatient(SHOW_NOTIFICATIONS, Font.Size);
     1596          SelectPatient(SHOW_NOTIFICATIONS, Font.Size, PtSelCancelled);
     1597        if PtSelCancelled then exit;
    15051598        ShowEverything;
    15061599        DisplayEncounterText;
     
    15361629      begin
    15371630        Notifications.Clear;
    1538         SelectPatient(False, Font.Size); // Call Pt. Sel. w/o notifications.
     1631        SelectPatient(False, Font.Size, PtSelCancelled); // Call Pt. Sel. w/o notifications.
     1632        if PtSelCancelled then exit;
    15391633        ShowEverything;
    1540         DisplayEncounterText;       
     1634        DisplayEncounterText;
    15411635        FPrevInPatient := Patient.Inpatient;
    15421636        ok := TRUE;
     
    15471641      if FCCOWInstalled and (ctxContextor.State = csParticipating) and (not FRefreshing) then
    15481642        begin
    1549           if (AllowCCOWContextChange(Patient.DFN)) then
     1643          if (AllowCCOWContextChange(CCOWResponse, Patient.DFN)) then
    15501644            begin
    15511645              SetupPatient;
     
    15551649          else
    15561650            begin
    1557               Patient.DFN := SaveDFN;
    1558               SetupPatient;
    1559               tabPage.TabIndex := PageIDToTab(NextTab);
    1560               tabPageChange(tabPage);
     1651              case CCOWResponse of
     1652                urCancel: UpdateCCOWContext;
     1653                urBreak:
     1654                  begin
     1655                    // do not revert to old DFN if context was manually broken by user - v26 (RV)
     1656                    if (ctxContextor.State = csParticipating) then Patient.DFN := SaveDFN;
     1657                    SetupPatient;
     1658                    tabPage.TabIndex := PageIDToTab(NextTab);
     1659                    tabPageChange(tabPage);
     1660                  end;
     1661              end;
    15611662            end;
    15621663        end
     
    15761677  if  BILLING_AWARE then frmFrame.SetBADxList; //end IsBillingAware
    15771678 {End BillingAware}
    1578 
     1679 //frmCover.UpdateVAAButton; //VAA CQ7525   CQ#7933 - moved to SetupPatient, before event hook execution (RV)
    15791680end;
    15801681
     
    16691770{ View Menu Events ------------------------------------------------------------------------- }
    16701771
    1671 procedure TfrmFrame.mnuViewDemoClick(Sender: TObject);
    1672 { displays patient inquiry report (which optionally allows new patient to be selected) }
    1673 var
    1674   SelectNew: Boolean;
    1675 begin
    1676   StatusText(TX_PTINQ);
    1677   PatientInquiry(SelectNew);
    1678   if Assigned(FLastPage) then
    1679     FLastPage.FocusFirstControl;
    1680   StatusText('');
    1681   if SelectNew then mnuFileOpenClick(mnuViewDemo);
    1682 end;
    1683 
    16841772procedure TfrmFrame.mnuViewPostingsClick(Sender: TObject);
    1685 { displays the window that shows crisis notes, warnings, allergies, & advance directives }
    1686 begin
    1687   ShowCWAD;
     1773begin
    16881774end;
    16891775
     
    19332019{ emulate a button press in the patient identification panel }
    19342020begin
     2021  if pnlPatient.BevelOuter = bvLowered then exit;
    19352022  pnlPatient.BevelOuter := bvLowered;
    19362023  with lblPtName do SetBounds(Left+2, Top+2, Width, Height);
     
    19432030{ emulate the button raising in the patient identification panel & call Patient Inquiry }
    19442031begin
     2032  if pnlPatient.BevelOuter = bvRaised then exit;
    19452033  pnlPatient.BevelOuter := bvRaised;
    19462034  with lblPtName do SetBounds(Left-2, Top-2, Width, Height);
     
    20342122  SetUserBounds2(RemDlgSplitters, RemDlgSpltr1, RemDlgSpltr2, Dummy ,Dummy);
    20352123  SetUserBounds2(DrawerSplitters,s1, s2, s3, Dummy);
     2124  if Assigned(frmSurgery) then frmSurgery.Drawers.LastOpenSize := Dummy; //CQ7315
    20362125  frmNotes.Drawers.LastOpenSize := s1;
    20372126  frmConsults.Drawers.LastOpenSize := s2;
     
    20452134     frmMeds.pnlBottom.Height := panelBottom;
    20462135     frmMeds.pnlMedIn.Height := panelMedIn;
     2136     //Meds Tab Non-VA meds columns
     2137     SetUserColumns(TControl(hdrMedsNonVA)); //CQ7314
    20472138     end;
    20482139
    2049   frmCover.DisableAlign;
     2140     frmCover.DisableAlign;
    20502141  try
    20512142    SetUserBounds2(CoverSplitters1, s1, s2, s3, s4);
     
    20762167var
    20772168  SizeList: TStringList;
     2169  SurgTempHt: integer;
    20782170begin
    20792171  SaveUserFontSize(MainFontSize);
     
    20982190      Add(StrUserBounds2(RemDlgName, RemDlgLeft, RemDlgTop, RemDlgWidth, RemDlgHeight));
    20992191      Add(StrUserBounds2(RemDlgSplitters, RemDlgSpltr1, RemDlgSpltr2, 0 ,0));
     2192
     2193      //v26.47 - RV - access violation if Surgery Tab not enabled.  Set to designer height as default.
     2194      if Assigned(frmSurgery) then SurgTempHt := frmSurgery.Drawers.pnlTemplates.Height else SurgTempHt := 85;
    21002195      Add(StrUserBounds2(DrawerSplitters, frmNotes.Drawers.LastOpenSize,
    21012196                                             frmConsults.Drawers.LastOpenSize,
    2102                                              frmDCSumm.Drawers.LastOpenSize,0));
     2197                                             frmDCSumm.Drawers.LastOpenSize,
     2198                                             SurgTempHt)); // last parameter = CQ7315
     2199
    21032200      Add(StrUserBounds2(CoverSplitters1,
    21042201        frmCover.pnl_1.Width,
     
    21142211      //Meds Tab Splitters
    21152212      Add(StrUserBounds2(frmMeds.Name+'Split',frmMeds.pnlBottom.Height,frmMeds.pnlMedIn.Height,0,0));
     2213
     2214      //Meds Tab Non-VA meds columns
     2215      Add(StrUserColumns(fMeds.frmMeds.hdrMedsNonVA)); //CQ7314
     2216
     2217      //Orders Tab columns
     2218      Add(StrUserColumns(fOrders.frmOrders.hdrOrders)); //CQ6328
    21162219
    21172220      if EnduringPtSelSplitterPos <> 0 then
     
    21852288      with lstCIRNLocations do Font.Size := NewFontSize;
    21862289      with tabPage       do Font.Size := NewFontSize;
     2290      with laMHV         do Font.Size := NewFontSize; //VAA
     2291      with laVAA2        do Font.Size := NewFontSize; //VAA
    21872292
    21882293      tabPage.Height := MainFontHeight + TAB_VOFFSET;   // resize tab selector
     
    21922297      stsArea.Panels[0].Width := ResizeWidth( OldFont, Font, stsArea.Panels[0].Width);
    21932298      stsArea.Panels[2].Width := ResizeWidth( OldFont, Font, stsArea.Panels[2].Width);
     2299
     2300      //VAA CQ8271
     2301      if ((fCover.PtIsVAA and fCover.PtIsMHV)) then
     2302        begin
     2303         laMHV.Height := (pnlToolBar.Height div 2) -1;
     2304         with laVAA2 do
     2305           begin
     2306           Top := laMHV.Top + laMHV.Height;
     2307           Height := (pnlToolBar.Height div 2) -1;
     2308           end;
     2309         end;
     2310      //end VAA
     2311
    21942312      RefreshFixedStatusWidth;
    21952313      FormResize( self );
     
    22062324    lblPtCWAD.Font.Color := clWindowText;
    22072325    lblFlag.Font.Color   := clWindowText;
     2326  end;
     2327
     2328  case (NewFontSize) of
     2329   8: mnu8pt.Checked := true;
     2330  10: mnu10pt1.Checked := true;
     2331  12: mnu12pt1.Checked := true;
     2332  14: mnu14pt1.Checked := true;
     2333  18: mnu18pt1.Checked := true;
     2334  24: mnu24pt1.Checked := true;
    22082335  end;
    22092336
     
    22232350  if Assigned(frmRemDlg) then frmRemDlg.SetFontSize;
    22242351  if Assigned(frmReminderTree) then frmReminderTree.SetFontSize(NewFontSize);
     2352  if GraphFloat <> nil then ResizeAnchoredFormToFont(GraphFloat);
    22252353end;
    22262354
     
    22312359  VISIT_WIDTH   = 36;
    22322360  POSTING_WIDTH = 11.5;
    2233   FLAG_WIDTH    =5;
     2361  FLAG_WIDTH    = 5;
    22342362  CIRN_WIDTH    = 7;
     2363  MHV_WIDTH     = 6;
    22352364  LINES_HIGH    = 2;
    22362365  M_HORIZ       = 4;
     
    22392368  M_WVERT       = 6;
    22402369  TINY_MARGIN   = 2;
    2241 var
    2242   WidthNeeded: integer;
     2370//var
     2371  //WidthNeeded: integer;
    22432372begin
    22442373  pnlToolbar.Height  := (LINES_HIGH * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ;
     
    22572386  pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
    22582387  pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
    2259   pnlCIRN.Width  := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT;
     2388  pnlCIRN.Width      := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT;
     2389  paVAA.Width        := Round(MHV_WIDTH * MainFontWidth) + M_WVERT;
    22602390  with lblPtPostings do
    22612391    SetBounds(M_WVERT, M_HORIZ, pnlPostings.Width-M_WVERT-M_WVERT, lblPtName.Height);
     
    22742404  end;
    22752405  //If that is not enough, add scroll bars to form
    2276   if pnlPrimaryCare.Width < HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN then
     2406  {if pnlPrimaryCare.Width < HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN then
    22772407  begin
    22782408    WidthNeeded := HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN - pnlPrimaryCare.Width;
     
    22802410    Width := Width + WidthNeeded;
    22812411  end
    2282   else
     2412  else }   // commented out - BA
    22832413    HorzScrollBar.Range := 0;
    22842414end;
    22852415
    22862416{ Temporary Calls -------------------------------------------------------------------------- }
     2417
     2418procedure TfrmFrame.ToggleMenuItemChecked(Sender: TObject);
     2419begin
     2420  with (Sender as TMenuItem) do
     2421     begin
     2422     if not Checked then
     2423        Checked := true
     2424     else
     2425        Checked := false;
     2426     end;
     2427end;
    22872428
    22882429procedure TfrmFrame.mnuFontSizeClick(Sender: TObject);
     
    22902431  if (frmRemDlg <> nil) then
    22912432    ShowMessage('Please close the reminder dialog before changing font sizes.')
    2292   else if (dlgProbs <> nil) then
     2433  else
     2434     if (dlgProbs <> nil) then
    22932435    ShowMessage('Font size cannot be changed while adding or editing a problem.')
    22942436  else
    2295     with Sender as TMenuItem do ChangeFont(Tag);
     2437     begin
     2438     with (Sender as TMenuItem) do
     2439        begin
     2440        ToggleMenuItemChecked(Sender);
     2441        fMeds.oldFont := MainFontSize; //CQ9182
     2442        ChangeFont(Tag);
     2443        end;
     2444     end;
    22962445end;
    22972446
     
    24132562    inherited;
    24142563  end;
    2415 end;
    2416 
    2417 procedure TfrmFrame.mnuViewRemindersClick(Sender: TObject);
    2418 begin
    2419   ViewReminderTree;
     2564  if Message.WParam = SC_MAXIMIZE then
     2565  begin
     2566    // form becomes maximized;
     2567    frmOrders.mnuOptimizeFieldsClick(self);
     2568    frmProblems.mnuOptimizeFieldsClick(self);
     2569    frmMeds.mnuOptimizeFieldsClick(self);
     2570  end
     2571  else if Message.WParam = SC_MINIMIZE then
     2572  begin
     2573    // form becomes maximized;
     2574  end
     2575  else if Message.WParam = SC_RESTORE then
     2576  begin
     2577    // form is restored (from maximized);
     2578    frmOrders.mnuOptimizeFieldsClick(self);
     2579    frmProblems.mnuOptimizeFieldsClick(self);
     2580    frmMeds.mnuOptimizeFieldsClick(self);
     2581  end;
    24202582end;
    24212583
     
    24232585var
    24242586  ImgName: string;
    2425 
    24262587begin
    24272588  pnlReminders.tag := HAVE_REMINDERS;
     
    24972658  pnlReminders.BevelOuter := bvRaised;
    24982659  if(pnlReminders.tag = HAVE_REMINDERS) then
    2499     mnuViewRemindersClick(Self);
     2660    ViewInfo(mnuViewReminders);
    25002661end;
    25012662
     
    25052666var
    25062667  i: integer;
     2668  aAutoQuery: string;
    25072669  ASite: TRemoteSite;
    25082670begin
    25092671  with RemoteSites do
     2672  if UseVistaWeb then
    25102673    begin
    25112674      ChangePatient(Patient.DFN);
     2675      lblCIRN.Caption := 'Remote';      //VistaWeb On
     2676      lblCIRNData.Caption := 'Data*';
     2677      pnlCIRN.Caption := 'Remote Data';
     2678      lblCIRN.Width := 43;
     2679      lblCIRNData.Width := 43;
     2680      lblCIRNData.Alignment := taCenter;
     2681      lblCIRN.Alignment := taCenter;
     2682      lblCIRN.Enabled     := True;
     2683      lblCIRNData.Enabled := True;
     2684      lblCIRNAvail.Enabled := True;
     2685      pnlCIRN.TabStop     := True;
    25122686      if RemoteDataExists and (RemoteSites.Count > 0) then
    25132687        begin
    25142688          lblCIRN.Enabled     := True;
    25152689          lblCIRNData.Enabled := True;
     2690          lblCIRNAvail.Enabled := True;
    25162691          pnlCIRN.TabStop     := True;
    25172692          if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then
     
    25192694              lblCIRN.Font.Color  := clBlue;
    25202695              lblCIRNData.Font.Color  := clBlue;
     2696              lblCIRNAvail.Font.Color := clBlue;
    25212697              lstCIRNLocations.Font.Color  := clBlue;
     2698              lblCIRN.Caption := 'Remote';
     2699              lblCIRNData.Caption := 'Data*';
     2700              lblCIRNAvail.Caption := 'Available';
     2701              pnlCIRN.Caption := 'Remote Data Available';
    25222702            end
    25232703          else
     
    25252705              lblCIRN.Font.Color  := clWindowText;
    25262706              lblCIRNData.Font.Color  := clWindowText;
     2707              lblCIRNAvail.Font.Color := clWindowText;
    25272708              lstCIRNLocations.Font.Color  := clWindowText;
    25282709            end;
     2710        end
     2711      else
     2712        begin
     2713          lblCIRN.Font.Color  := clWindowText;
     2714          lblCIRNData.Font.Color  := clWindowText;
     2715          lblCIRNAvail.Font.Color := clWindowText;
     2716          lblCIRN.Enabled     := False;
     2717          lblCIRNData.Enabled := False;
     2718          lblCIRNAvail.Enabled := False;
     2719          pnlCIRN.TabStop     := False;
     2720          pnlCIRN.Hint := NoDataReason;
     2721        end;
     2722      pnlCIRN.Hint := 'Click to open VistaWeb';
     2723    end
     2724  else
     2725    begin
     2726      ChangePatient(Patient.DFN);
     2727      lblCIRN.Caption := ' Remote';
     2728      lblCIRNData.Caption := 'Data';
     2729      pnlCIRN.Caption := 'Remote Data';
     2730      lblCIRNAvail.Caption := '';
     2731      lblCIRN.Width := 43;
     2732      lblCIRNData.Width := 43;
     2733      lblCIRNData.Alignment := taCenter;
     2734      lblCIRN.Alignment := taCenter;
     2735      if RemoteDataExists and (RemoteSites.Count > 0) then
     2736        begin
     2737          lblCIRN.Enabled     := True;
     2738          lblCIRNData.Enabled := True;
     2739          lblCIRNAvail.Enabled := True;
     2740          pnlCIRN.TabStop     := True;
     2741          if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then
     2742            begin
     2743              lblCIRN.Font.Color  := clBlue;
     2744              lblCIRNData.Font.Color  := clBlue;
     2745              lblCIRNAvail.Font.Color := clBlue;
     2746              lstCIRNLocations.Font.Color  := clBlue;
     2747              lblCIRN.Caption := 'Remote';
     2748              lblCIRNData.Caption := 'Data';
     2749              lblCIRNAvail.Caption := 'Available';
     2750              pnlCIRN.Caption := 'Remote Data Available';
     2751            end
     2752          else
     2753            begin
     2754              lblCIRN.Font.Color  := clWindowText;
     2755              lblCIRNData.Font.Color  := clWindowText;
     2756              lblCIRNAvail.Font.Color := clWindowText;
     2757              lstCIRNLocations.Font.Color  := clWindowText;
     2758              lblCIRNAvail.Color := clWindowText;
     2759            end;
    25292760          pnlCIRN.Hint := 'Click to display other facilities having data for this patient.';
     2761          lstCIRNLocations.Items.Add('-1' + U + 'Use VistaWeb from now on');
    25302762          if RemoteSites.Count > 0 then
    25312763            lstCIRNLocations.Items.Add('0' + U + 'All Available Sites');
     
    25412773          lblCIRN.Font.Color  := clWindowText;
    25422774          lblCIRNData.Font.Color  := clWindowText;
     2775          lblCIRNAvail.Font.Color := clWindowText;
    25432776          lblCIRN.Enabled     := False;
    25442777          lblCIRNData.Enabled := False;
     2778          lblCIRNAvail.Enabled := False;
    25452779          pnlCIRN.TabStop     := False;
    25462780          pnlCIRN.Hint := NoDataReason;
    25472781        end;
     2782    aAutoQuery := AutoRDV;        //Check to see if Remote Queries should be used for all available sites
     2783    if (aAutoQuery = '1') and (lstCIRNLocations.Count > 0) then
     2784      begin
     2785        lstCIRNLocations.ItemIndex := 1;
     2786        lstCIRNLocations.Checked[1] := true;
     2787        lstCIRNLocationsClick(self);
     2788      end;
     2789  end;
     2790end;
     2791
     2792procedure TfrmFrame.pnlCIRNClick(Sender: TObject);
     2793//var
     2794//  aAddress: string;
     2795begin
     2796  {if UseVistaWeb then
     2797    begin
     2798      pnlCIRN.BevelOuter := bvRaised;
     2799      pnlCIRN.Hint := 'Click to open VistaWeb';
     2800      lblCIRN.Width := 43;
     2801      lblCIRNData.Width := 43;
     2802      lblCIRNData.Alignment := taCenter;
     2803      lblCIRN.Alignment := taCenter;
     2804      lstCIRNLocations.Visible := false;
     2805      lstCIRNLocations.SendToBack;
     2806      aAddress := GetVistaWebAddress(Patient.DFN);
     2807      ShellExecute(Handle, 'open', PChar(aAddress), PChar(''), '', SW_NORMAL);
     2808      Exit;
    25482809    end;
    2549 end;
    2550 
    2551 procedure TfrmFrame.pnlCIRNClick(Sender: TObject);
    2552 begin
    25532810  if not RemoteSites.RemoteDataExists then Exit;
    25542811  if (not lstCIRNLocations.Visible) then
     
    25662823      lstCIRNLocations.SendToBack;
    25672824      pnlCIRN.Hint := 'Click to display other facilities having data for this patient.';
    2568     end
     2825    end }
     2826  ViewInfo(mnuViewRemoteData);
    25692827end;
    25702828
     
    25812839  AccessStatus: integer;
    25822840begin
    2583   iAll := 0;
     2841  iAll := 1;
    25842842  AccessStatus := 0;
     2843  iIndex := lstCIRNLocations.ItemIndex;
     2844  if iIndex = 0 then
     2845    if (piece(lstCIRNLocations.Items[0],'^',1) = '-1') and (lstCIRNLocations.Checked[iIndex] = true) then
     2846      begin
     2847        if MessageDlg('Are you sure you want to make VistaWeb your default for viewing Remote Data?',
     2848          mtConfirmation, [mbYes, mbNo], 0) = mrYes then
     2849          begin
     2850            ChangeVistaWebParam('1');
     2851            lblCIRN.Caption := 'Remote';          //VistaWeb On
     2852            lblCIRNData.Caption := 'Data*';
     2853            pnlCIRN.Caption := 'Remote Data';
     2854            lblCIRNAvail.Caption := '';
     2855            lblCIRN.Width := 43;
     2856            lblCIRNData.Width := 43;
     2857            lblCIRNData.Alignment := taCenter;
     2858            lblCIRN.Alignment := taCenter;
     2859            with RemoteSites do if RemoteDataExists and (RemoteSites.Count > 0) then
     2860              begin
     2861                lblCIRN.Enabled     := True;
     2862                lblCIRNData.Enabled := True;
     2863                pnlCIRN.TabStop     := True;
     2864                if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then
     2865                  begin
     2866                    lblCIRN.Font.Color  := clBlue;
     2867                    lblCIRNData.Font.Color  := clBlue;
     2868                    lstCIRNLocations.Font.Color  := clBlue;
     2869                    lblCIRN.Caption := 'Remote';
     2870                    lblCIRNData.Caption := 'Data*';
     2871                    lblCIRNAvail.Caption := 'Available';
     2872                    pnlCIRN.Caption := 'Remote Data Available';
     2873                  end
     2874                else
     2875                  begin
     2876                    lblCIRN.Font.Color  := clWindowText;
     2877                    lblCIRNData.Font.Color  := clWindowText;
     2878                    lstCIRNLocations.Font.Color  := clWindowText;
     2879                    lblCIRNAvail.Font.Color := clWindowText;
     2880                  end;
     2881              end;
     2882            pnlCIRNClick(self);
     2883            Exit;
     2884          end
     2885        else
     2886          lstCIRNLocations.Checked[iIndex] := false;
     2887      end
     2888    else
     2889      begin
     2890        ChangeVistaWebParam('0');
     2891        lblCIRN.Caption := 'Remote';
     2892        lblCIRNData.Caption := 'Data';
     2893        pnlCIRN.Caption := 'Remote Data';
     2894        lblCIRN.Width := 43;
     2895        lblCIRNData.Width := 43;
     2896        lblCIRNData.Alignment := taCenter;
     2897        lblCIRN.Alignment := taCenter;
     2898        pnlCIRNClick(self);
     2899        Exit;
     2900      end;
    25852901  if not CheckHL7TCPLink then
    25862902    begin
    25872903      InfoBox('Local HL7 TCP Link is down.' + CRLF + 'Unable to retrieve remote data.', TC_DGSR_ERR, MB_OK);
    2588       lstCIRNLocations.Checked[lstCIRNLocations.ItemIndex] := false;
     2904      lstCIRNLocations.Checked[iIndex] := false;
    25892905      Exit;
    25902906    end;
    2591   if lstCIRNLocations.Items.Count > 0 then
    2592     if piece(lstCIRNLocations.Items[0],'^',1) = '0' then
    2593       iAll := 1;
    2594   iIndex := lstCIRNLocations.ItemIndex;
     2907  if lstCIRNLocations.Items.Count > 1 then
     2908    if piece(lstCIRNLocations.Items[1],'^',1) = '0' then
     2909      iAll := 2;
    25952910  with frmReports do
    25962911    if piece(uRemoteType,'^',2) = 'V' then
     
    26122927        with RemoteSites.SiteList do
    26132928        for j := 0 to Count - 1 do
    2614           if lstCIRNLocations.Checked[j+1] = true then
     2929          if lstCIRNLocations.Checked[j+2] = true then
    26152930            begin
    2616               lstCIRNLocations.Checked[j+1] := false;
     2931              lstCIRNLocations.Checked[j+2] := false;
    26172932              TRemoteSite(RemoteSites.SiteList[j]).Selected := false;
    26182933              TRemoteSite(RemoteSites.SiteList[j]).ReportClear;
     
    26302945              Screen.Cursor := crDefault;
    26312946              aMsg := aMsg + ' at site: ' + TRemoteSite(Items[j]).SiteName;
    2632               s := lstCIRNLocations.Items[j+1];
    2633               lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3);
     2947              s := lstCIRNLocations.Items[j+2];
     2948              lstCIRNLocations.Items[j+2] := pieces(s, '^', 1, 3);
    26342949              case AccessStatus of
    26352950              DGSR_FAIL: begin
    26362951                           if piece(aMsg,':',1) = 'RPC name not found at site' then //Allow for backward compatibility
    26372952                             begin
    2638                                lstCIRNLocations.Checked[j+1] := true;
     2953                               lstCIRNLocations.Checked[j+2] := true;
    26392954                               TRemoteSite(RemoteSites.SiteList[j]).ReportClear;
    26402955                               TRemoteSite(RemoteSites.SiteList[j]).LabClear;
     
    26442959                             begin
    26452960                               InfoBox(aMsg, TC_DGSR_ERR, MB_OK);
    2646                                lstCIRNLocations.Checked[j+1] := false;
    2647                                lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_ERR;
     2961                               lstCIRNLocations.Checked[j+2] := false;
     2962                               lstCIRNLocations.Items[j+2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_ERR;
    26482963                               TRemoteSite(Items[j]).Selected := false;
    26492964                               Continue;
     
    26512966                         end;
    26522967              DGSR_NONE: begin
    2653                            lstCIRNLocations.Checked[j+1] := true;
     2968                           lstCIRNLocations.Checked[j+2] := true;
    26542969                           TRemoteSite(RemoteSites.SiteList[j]).ReportClear;
    26552970                           TRemoteSite(RemoteSites.SiteList[j]).LabClear;
     
    26582973              DGSR_SHOW: begin
    26592974                           InfoBox(AMsg, TC_DGSR_SHOW, MB_OK);
    2660                            lstCIRNLocations.Checked[j+1] := true;
     2975                           lstCIRNLocations.Checked[j+2] := true;
    26612976                           TRemoteSite(RemoteSites.SiteList[j]).ReportClear;
    26622977                           TRemoteSite(RemoteSites.SiteList[j]).LabClear;
     
    26662981                           MB_DEFBUTTON2) = IDYES then
    26672982                           begin
    2668                              lstCIRNLocations.Checked[j+1] := true;
     2983                             lstCIRNLocations.Checked[j+2] := true;
    26692984                             TRemoteSite(RemoteSites.SiteList[j]).ReportClear;
    26702985                             TRemoteSite(RemoteSites.SiteList[j]).LabClear;
     
    26732988                           else
    26742989                             begin
    2675                                lstCIRNLocations.Checked[j+1] := false;
    2676                                lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_SHOW;
     2990                               lstCIRNLocations.Checked[j+2] := false;
     2991                               lstCIRNLocations.Items[j+2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_SHOW;
    26772992                               TRemoteSite(Items[j]).Selected := false;
    26782993                               Continue;
     
    26802995              else       begin
    26812996                           InfoBox(AMsg, TC_DGSR_DENY, MB_OK);
    2682                            lstCIRNLocations.Checked[j+1] := false;
    2683                            lstCIRNLocations.Items[j+1] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_DENY;
     2997                           lstCIRNLocations.Checked[j+2] := false;
     2998                           lstCIRNLocations.Items[j+2] := pieces(s, '^', 1, 3) + '^' + TC_DGSR_DENY;
    26842999                           TRemoteSite(Items[j]).Selected := false;
    26853000                           Continue;
     
    26903005  else
    26913006    begin
    2692       if iIndex > -1 then
     3007      if iIndex > 0 then
    26933008        begin
    26943009          iCur := iIndex - iAll;
     
    27793094            TRemoteSite(Items[j]));
    27803095        end;
    2781   frmLabs.TabControl1.OnChange(nil);
    2782   frmReports.TabControl1.OnChange(nil);
     3096  //frmLabs.TabControl1.OnChange(nil);
     3097  //frmReports.TabControl1.OnChange(nil);
     3098  if frmReports.tvReports.SelectionCount > 0 then frmReports.tvReportsClick(self);
     3099  if frmLabs.lstReports.ItemIndex > -1 then frmLabs.ExtlstReportsClick(self, true);
    27833100  StatusText('');
    27843101end;
     
    28173134procedure TfrmFrame.lstCIRNLocationsChange(Sender: TObject);
    28183135begin
    2819   if lstCIRNLocations.ItemIndex > -1 then
     3136  if lstCIRNLocations.ItemIndex > 0 then
    28203137    if (lstCIRNLocations.Selected[lstCIRNLocations.ItemIndex] = true) and (uUpdateStat = false) then
    2821       if not (piece(lstCIRNLocations.Items[0],'^',1) = '0') then
     3138      if not (piece(lstCIRNLocations.Items[1],'^',1) = '0') then
    28223139        lstCIRNLocations.OnClick(nil);
    28233140end;
     
    28523169  if not Notifications.Active then Exit;
    28533170  case Notifications.Followup of
    2854     NF_MEDICATIONS_EXPIRING         : AlertType := 'Expiring Medications';
     3171    NF_MEDICATIONS_EXPIRING_INPT    : AlertType := 'Expiring Medications';
     3172    NF_MEDICATIONS_EXPIRING_OUTPT   : AlertType := 'Expiring Medications';
    28553173    NF_ORDER_REQUIRES_ELEC_SIGNATURE: AlertType := 'Unsigned Orders';
    28563174    NF_FLAGGED_ORDERS               : AlertType := 'Flagged Orders (for clarification)';
     
    29353253     FOSTFhintWindow.ReleaseHandle;
    29363254     FOSTFHintWndActive := False ;
    2937 
     3255  end;
     3256  if FHintWinActive then   // graphing - hints on values
     3257  begin
     3258    FHintWin.ReleaseHandle;
     3259    FHintWinActive := false;
    29383260  end;
    29393261end;
     
    30803402  Patient.Clear;
    30813403  Patient.DFN := tmpDFN;
     3404  uCore.TempEncounterLoc := 0;  //hds7591  Clinic/Ward movement.
     3405  uCore.TempEncounterLocName := ''; //hds7591  Clinic/Ward movement.
    30823406
    30833407  if (FPrevInPatient and Patient.Inpatient) then                //transfering inside hospital
     
    30923416  begin
    30933417    Encounter.Inpatient := True;
     3418    uCore.TempEncounterLoc := Encounter.Location;  //hds7591  Clinic/Ward movement.
     3419    uCore.TempEncounterLocName := Encounter.LocationName; //hds7591  Clinic/Ward movement.
    30943420    Encounter.Location := Patient.Location;
    30953421    Encounter.DateTime := Patient.AdmitTime;
     
    31013427end;
    31023428
    3103 procedure TfrmFrame.FormKeyDown(Sender: TObject; var Key: Word;
    3104   Shift: TShiftState);
     3429procedure TfrmFrame.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    31053430var
    31063431  NewTabIndex: integer;
     
    31083433  //CQ2844: Toggle Remote Data button using Alt+R
    31093434   case Key of
    3110      82,114:  begin
    3111               if (ssAlt in Shift) then
     3435     82,114:  if (ssAlt in Shift) then
    31123436                 frmFrame.pnlCIRNClick(Sender);
    3113               end;
    31143437     end;
    31153438
     
    31733496procedure TfrmFrame.pnlPatientClick(Sender: TObject);
    31743497begin
    3175   mnuViewDemoClick(Self);
     3498  ViewInfo(mnuViewDemo);
    31763499end;
    31773500
    31783501procedure TfrmFrame.pnlVisitClick(Sender: TObject);
    31793502begin
    3180   if (not User.IsReportsOnly) then // Reports Only tab.
    3181     mnuFileEncounterClick(Self);
     3503 //if (not User.IsReportsOnly) then // Reports Only tab.
     3504 //  mnuFileEncounterClick(Self);
     3505  ViewInfo(mnuViewVisits);
    31823506end;
    31833507
    31843508procedure TfrmFrame.pnlPrimaryCareClick(Sender: TObject);
    31853509begin
    3186   ReportBox(DetailPrimaryCare(Patient.DFN), 'Primary Care', True);
     3510  //ReportBox(DetailPrimaryCare(Patient.DFN), 'Primary Care', True);
     3511  ViewInfo(mnuViewPrimaryCare);
    31873512end;
    31883513
     
    31903515begin
    31913516  if(pnlReminders.tag = HAVE_REMINDERS) then
    3192     mnuViewRemindersClick(Self);
     3517      ViewInfo(mnuViewReminders);
     3518
    31933519end;
    31943520
    31953521procedure TfrmFrame.pnlPostingsClick(Sender: TObject);
    31963522begin
    3197   mnuViewPostingsClick(Self);
     3523  ViewInfo(mnuViewPostings);
    31983524end;
    31993525
     
    32163542end;
    32173543
    3218 function TfrmFrame.AllowCCOWContextChange(NewDFN: string): boolean;
     3544function TfrmFrame.AllowCCOWContextChange(var CCOWResponse: UserResponse; NewDFN: string): boolean;
    32193545var
    32203546  PtData : IContextItemCollection;
     
    32483574          IsProdAcct := User.IsProductionAccount;
    32493575
     3576          {$IFDEF CCOWBROKER}
     3577          //IsProdAcct := RPCBrokerV.Login.IsProduction;  //not yet
     3578          {$ENDIF}
     3579
    32503580          PtDataItem2 := CoContextItem.Create();
    32513581          PtDataItem2.Set_Name('Patient.co.PatientName');                // Patient.Name
     
    32933623      end;
    32943624
     3625    CCOWResponse := response;
    32953626    if (response = UrCommit) then
    32963627    begin
     
    33553686  Reason, HyperLinkReason: string;
    33563687  PtChanged: boolean;
     3688{$IFDEF CCOWBROKER}
     3689  UserChanged: boolean;
     3690{$ENDIF}
    33573691begin
    33583692  // If the app would lose data, or have other problems changing context at
     
    33703704  try
    33713705    CheckForDifferentPatient(aContextItemCollection, PtChanged);
     3706{$IFDEF CCOWBROKER}
     3707    CheckForDifferentUser(aContextItemCollection, UserChanged);
     3708{$ENDIF}
    33723709  except
    33733710    on E: Exception do HandleCCOWError(E.Message);
     
    33793716  end;
    33803717
     3718{$IFDEF CCOWBROKER}
     3719  if PtChanged or UserChanged then
     3720{$ELSE}
    33813721  if PtChanged then
     3722{$ENDIF}
    33823723    begin
    33833724      FCCOWContextChanging := True;
     
    34043745  FCCOWError := False;
    34053746  try
    3406   CheckForDifferentPatient(ctxContextor.CurrentContext, PtChanged);
     3747  {$IFDEF CCOWBROKER}
     3748    with RPCBrokerV do if (WasUserDefined and IsUserCleared and (ctxContextor.CurrentContext.Present(CCOW_USER_NAME) = nil)) then    // RV 05/11/04
     3749    begin
     3750      Reason := 'COMMIT';
     3751      if AllowContextChangeAll(Reason) then
     3752      begin
     3753        Close;
     3754        Exit;
     3755      end;
     3756    end;
     3757  {$ENDIF}
     3758    CheckForDifferentPatient(ctxContextor.CurrentContext, PtChanged);
    34073759  except
    34083760    on E: Exception do HandleCCOWError(E.Message);
     
    34573809  end;
    34583810  IsProdAcct := User.IsProductionAccount;
     3811  {$IFDEF CCOWBROKER}
     3812  //IsProdAcct := RPCBrokerV.Login.IsProduction;  //not yet
     3813  {$ENDIF}
    34593814  // Get an item collection of the current context
    34603815  FCCOWError := False;
     
    34953850  //PtDFN := FindBestCCOWDFN(PtName);
    34963851  PtDFN := FindBestCCOWDFN;
    3497   if PtDFN <> '' then
     3852  if StrToInt64Def(PtDFN, 0) > 0 then
    34983853    begin
    34993854      // Select new patient based on context value
     
    35173872      end;
    35183873      if User.IsProvider then Encounter.Provider := User.DUZ;
    3519       SetupPatient;
     3874      if not FFirstLoad then SetupPatient;
     3875      frmCover.UpdateVAAButton; //VAA
    35203876      DetermineNextTab;
    35213877      tabPage.TabIndex := PageIDToTab(NextTab);
     
    35713927
    35723928procedure TfrmFrame.mnuFileResumeContextSetClick(Sender: TObject);
    3573 begin
     3929var
     3930  CCOWResponse: UserResponse;
     3931  Reason: string;
     3932begin
     3933  Reason := '';
     3934  if not AllowContextChangeAll(Reason) then exit;
    35743935  FCCOWIconName := 'BMP_CCOW_CHANGING';
    35753936  pnlCCOW.Hint := TX_CCOW_CHANGING;
     
    35823943  end;
    35833944  if FCCOWError then exit;
    3584   if (AllowCCOWContextChange(Patient.DFN)) then
     3945  if (AllowCCOWContextChange(CCOWResponse, Patient.DFN)) then
    35853946    begin
    35863947      mnuFileResumeContext.Enabled := False;
     
    35983959      pnlCCOW.Hint := TX_CCOW_BROKEN;
    35993960      imgCCOW.Picture.BitMap.LoadFromResourceName(hInstance, FCCOWIconName);
     3961      try
     3962        if ctxContextor.State in [csParticipating] then ctxContextor.Suspend;
     3963      except
     3964        on E: Exception do HandleCCOWError(E.Message);
     3965      end;
    36003966   end;
    36013967  SetupPatient;
     
    36073973var
    36083974  data : IContextItemCollection;
    3609   anItem : IContextItem;
     3975  anItem: IContextItem;
    36103976  PtDFN, PtName: string;
    36113977begin
     
    36233989  PtChanged := not ((PtDFN = Patient.DFN) and (PtName = Piece(Patient.Name, ',', 1) + U + Piece(Patient.Name, ',', 2) + '^^^^'));
    36243990end;
     3991
     3992{$IFDEF CCOWBROKER}
     3993procedure TfrmFrame.CheckForDifferentUser(aContextItemCollection: IDispatch; var UserChanged: boolean);
     3994var
     3995  data : IContextItemCollection;
     3996begin
     3997  if uCore.User = nil then
     3998  begin
     3999    UserChanged := False;
     4000    Exit;
     4001  end;
     4002  data := IContextItemCollection(aContextItemCollection) ;
     4003  UserChanged := RPCBrokerV.IsUserContextPending(data);
     4004end;
     4005{$ENDIF}
    36254006
    36264007procedure TfrmFrame.CheckHyperlinkResponse(aContextItemCollection: IDispatch; var HyperlinkReason: string);
     
    36514032procedure TfrmFrame.HideEverything;
    36524033begin
     4034  FNoPatientSelected := TRUE;
    36534035  pnlNoPatientSelected.Visible := True;
    36544036  pnlNoPatientSelected.BringToFront;
     
    36714053procedure TfrmFrame.ShowEverything;
    36724054begin
     4055  FNoPatientSelected := FALSE;
    36734056  pnlNoPatientSelected.Visible := False;
    36744057  pnlNoPatientSelected.SendToBack;
     
    37114094procedure TfrmFrame.pnlFlagClick(Sender: TObject);
    37124095begin
    3713   ShowFlags;
     4096  //ShowFlags;
     4097  ViewInfo(mnuViewFlags);
    37144098end;
    37154099
     
    38124196
    38134197procedure TfrmFrame.ScreenActiveFormChange(Sender: TObject);
     4198begin
     4199  if(assigned(FOldActiveFormChange)) then
     4200    FOldActiveFormChange(Sender);
     4201  //Focus the Form that Stays on Top after the Application Regains focus.
     4202  if FJustEnteredApp then
     4203    FocusApplicationTopForm;
     4204  FJustEnteredApp := false;
     4205end;
     4206
     4207procedure TfrmFrame.FocusApplicationTopForm;
    38144208var
    38154209  I : integer;
    38164210begin
    3817   //Locate the Form that Stays on Top after the Application Regains focus.
    3818   if FJustEnteredApp then
    3819   begin
    3820     for I := (Screen.FormCount-1) downto 0 do //Set the last one opened last
    3821     begin
    3822       with Screen.Forms[I] do
    3823         if (FormStyle = fsStayOnTop) and (Enabled) and (Visible) then
    3824           SetFocus;
     4211  for I := (Screen.FormCount-1) downto 0 do //Set the last one opened last
     4212  begin
     4213    with Screen.Forms[I] do
     4214      if (FormStyle = fsStayOnTop) and (Enabled) and (Visible) then
     4215        SetFocus;
     4216  end;
     4217end;
     4218
     4219procedure TfrmFrame.AppEventsShortCut(var Msg: TWMKey;
     4220  var Handled: Boolean);
     4221begin
     4222  if ((Boolean(Hi(GetKeyState(VK_MENU{ALT})))) and (Msg.CharCode = VK_F1)) then
     4223  begin
     4224    FocusApplicationTopForm;
     4225    Handled := True;
     4226  end;
     4227end;
     4228
     4229procedure TfrmFrame.mnuToolsGraphingClick(Sender: TObject);
     4230begin
     4231  Screen.Cursor := crHourGlass;
     4232  if GraphFloat = nil then              // new graph
     4233  begin
     4234    GraphFloat := TfrmGraphs.Create(self);
     4235    try
     4236      with GraphFloat do
     4237      begin
     4238        if btnClose.Tag = 1 then
     4239          Exit;
     4240        Initialize;
     4241        Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name);
     4242        BorderIcons := [biSystemMenu, biMaximize, biMinimize];
     4243        BorderStyle := bsSizeable;
     4244        BorderWidth := 1;
     4245        // context sensitive       type (tabPage.TabIndex)  & [item]
     4246        ResizeAnchoredFormToFont(GraphFloat);
     4247        Show;
     4248      end;
     4249    finally
     4250      if GraphFloat.btnClose.Tag = 1 then
     4251      begin
     4252        GraphFloatActive := false;
     4253        GraphFloat.Free;
     4254        GraphFloat := nil;
     4255      end
     4256      else
     4257        GraphFloatActive := true;
    38254258    end;
    3826     FJustEnteredApp := false;
    3827   end;
    3828 end;
    3829 
     4259  end
     4260  else if GraphFloat.btnClose.Tag = 1 then
     4261    Exit
     4262  else if GraphFloatActive and (GraphFloat.lstTypes.Hint = Patient.DFN) then
     4263    GraphFloat.BringToFront             // graph is active, same patient
     4264  else if GraphFloat.lstTypes.Hint = Patient.DFN then
     4265  begin                                 // graph is not active, same patient
     4266    // context sensitive
     4267    GraphFloat.Show;
     4268    GraphFloatActive := true;
     4269  end
     4270  else
     4271  //with GraphFloat do                    // new patient
     4272  begin
     4273    GraphFloat.InitialRetain;
     4274    GraphFloatActive := false;
     4275    GraphFloat.Free;
     4276    GraphFloat := nil;
     4277    mnuToolsGraphingClick(self);          // delete and recurse
     4278    {//FormCreate(self);   //****************
     4279    Initialize;
     4280    DisplayData('top');
     4281    DisplayData('bottom');
     4282    lstCheck.Items.Clear;
     4283    Caption := 'CPRS Graphing - Patient: ' + MixedCase(Patient.Name);
     4284    // context sensitive
     4285    Show;
     4286    GraphFloatActive := true;}
     4287  end;
     4288  Screen.Cursor := crDefault;
     4289end;
     4290
     4291procedure TfrmFrame.pnlCIRNMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     4292begin
     4293  pnlCIRN.BevelOuter := bvLowered;
     4294end;
     4295
     4296procedure TfrmFrame.pnlCIRNMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     4297begin
     4298  pnlCIRN.BevelOuter := bvRaised;
     4299end;
     4300
     4301procedure TfrmFrame.laMHVClick(Sender: TObject);
     4302begin
     4303  //if laMHV.Caption = 'MHV' then
     4304  //  ShellExecute(Handle, 'open', PChar('http://www.myhealth.va.gov/'), '', '', SW_NORMAL);
     4305  ViewInfo(mnuViewMyHealtheVet);
     4306end;
     4307
     4308procedure TfrmFrame.laVAA2Click(Sender: TObject);
     4309{var
     4310  InsuranceSubscriberName: string;
     4311  ReportString: TStringList; //CQ7782 }
     4312begin
     4313  {if fCover.VAAFlag[0] <> '0' then //'0' means subscriber not found
     4314     begin
     4315     InsuranceSubscriberName := fCover.VAAFlag[12];
     4316     //CQ7782
     4317     //ReportString := TStringList.Create;
     4318     ReportString := VAAFlag;
     4319     ReportString[0] := '';
     4320     ReportBox(ReportString, InsuranceSubscriberName, True);
     4321     //end CQ7782
     4322     end;}
     4323  ViewInfo(mnuInsurance);
     4324end;
     4325
     4326procedure TfrmFrame.ViewInfo(Sender: TObject);
     4327var
     4328  SelectNew: Boolean;
     4329  InsuranceSubscriberName: string;
     4330  ReportString: TStringList;
     4331  aAddress: string;
     4332begin
     4333  case (Sender as TMenuItem).Tag of
     4334    1:begin { displays patient inquiry report (which optionally allows new patient to be selected) }
     4335        StatusText(TX_PTINQ);
     4336        PatientInquiry(SelectNew);
     4337        if Assigned(FLastPage) then
     4338          FLastPage.FocusFirstControl;
     4339        StatusText('');
     4340        if SelectNew then mnuFileOpenClick(mnuViewDemo);
     4341      end;
     4342    2:begin
     4343        if (not User.IsReportsOnly) then // Reports Only tab.
     4344          mnuFileEncounterClick(Self);
     4345      end;
     4346    3:begin
     4347        ReportBox(DetailPrimaryCare(Patient.DFN), 'Primary Care', True);
     4348      end;
     4349    4:begin
     4350        if laMHV.Caption = 'MHV' then
     4351          ShellExecute(laMHV.Handle, 'open', PChar('http://www.myhealth.va.gov/'), '', '', SW_NORMAL);
     4352      end;
     4353    5:begin
     4354        if fCover.VAAFlag[0] <> '0' then //'0' means subscriber not found
     4355        begin
     4356          InsuranceSubscriberName := fCover.VAAFlag[12];
     4357          ReportString := VAAFlag;
     4358          ReportString[0] := '';
     4359          ReportBox(ReportString, InsuranceSubscriberName, True);
     4360        end;
     4361      end;
     4362    6:begin
     4363        ShowFlags;
     4364      end;
     4365    7:begin
     4366        if UseVistaWeb then
     4367          begin
     4368            pnlCIRN.BevelOuter := bvRaised;
     4369            pnlCIRN.Hint := 'Click to open VistaWeb';
     4370            lblCIRN.Width := 43;
     4371            lblCIRNData.Width := 43;
     4372            lblCIRNData.Alignment := taCenter;
     4373            lblCIRN.Alignment := taCenter;
     4374            lstCIRNLocations.Visible := false;
     4375            lstCIRNLocations.SendToBack;
     4376            aAddress := GetVistaWebAddress(Patient.DFN);
     4377            ShellExecute(pnlCirn.Handle, 'open', PChar(aAddress), PChar(''), '', SW_NORMAL);
     4378            Exit;
     4379          end;
     4380        if not RemoteSites.RemoteDataExists then Exit;
     4381        if (not lstCIRNLocations.Visible) then
     4382          begin
     4383            pnlCIRN.BevelOuter := bvLowered;
     4384            lstCIRNLocations.Visible := True;
     4385            lstCIRNLocations.BringToFront;
     4386            lstCIRNLocations.SetFocus;
     4387            pnlCIRN.Hint := 'Click to close list.';
     4388          end
     4389        else
     4390          begin
     4391            pnlCIRN.BevelOuter := bvRaised;
     4392            lstCIRNLocations.Visible := False;
     4393            lstCIRNLocations.SendToBack;
     4394            pnlCIRN.Hint := 'Click to display other facilities having data for this patient.';
     4395          end;
     4396      end;
     4397    8:begin
     4398        ViewReminderTree;
     4399      end;
     4400    9:begin { displays the window that shows crisis notes, warnings, allergies, & advance directives }
     4401        ShowCWAD;
     4402      end;
     4403  end;
     4404end;
     4405
     4406procedure TfrmFrame.mnuViewInformationClick(Sender: TObject);
     4407begin
     4408  mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled;
     4409  mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled;
     4410  mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled;
     4411  mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No');
     4412  mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No');
     4413  mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled;
     4414  mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled;
     4415  mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled;
     4416  mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled;
     4417end;
    38304418
    38314419initialization
     
    38334421finalization
    38344422
     4423
    38354424end.
    38364425
     4426
Note: See TracChangeset for help on using the changeset viewer.