Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

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

    r830 r1679  
    55{$OPTIMIZATION OFF}                              // REMOVE AFTER UNIT IS DEBUGGED
    66{$WARN SYMBOL_PLATFORM OFF}
    7 {$DEFINE CCOWBROKER}
    8 
     7{$DEFINE CCOWBROKER}                             
     8                               
    99{.$define debug}
    1010
     
    1515  ExtCtrls, Menus, StdCtrls, Buttons, ORFn, fPage, uConst, ORCtrls, Trpcb,
    1616  OleCtrls, VERGENCECONTEXTORLib_TLB, ComObj, AppEvnts, fBase508Form,
    17   VA508AccessibilityManager
    18 { TODO -oRV -cWVEHR Long Age : Changed to use long age }
    19   , rWVEHR;
     17  VA508AccessibilityManager, RichEdit;
    2018
    2119type
     
    109107    pnlPatientSelected: TPanel;
    110108    pnlNoPatientSelected: TPanel;
    111     pnlFlag: TKeyClickPanel;
    112     lblFlag: TLabel;
    113109    pnlPostings: TKeyClickPanel;
    114110    lblPtPostings: TStaticText;
     
    132128    mnuViewRemoteData: TMenuItem;
    133129    compAccessTabPage: TVA508ComponentAccessibility;
     130    pnlCVnFlag: TPanel;
     131    btnCombatVet: TButton;
     132    pnlFlag: TKeyClickPanel;
     133    lblFlag: TLabel;
    134134    pnlRemoteData: TKeyClickPanel;
    135135    pnlVistaWeb: TKeyClickPanel;
     
    137137    pnlCIRN: TKeyClickPanel;
    138138    lblCIRN: TLabel;
     139    mnuEditRedo: TMenuItem;
    139140    procedure tabPageChange(Sender: TObject);
    140141    procedure FormCreate(Sender: TObject);
     
    143144      Shift: TShiftState; X, Y: Integer);
    144145    procedure pnlPatientMouseUp(Sender: TObject; Button: TMouseButton;
     146      Shift: TShiftState; X, Y: Integer);
     147    procedure pnlVisitMouseDown(Sender: TObject; Button: TMouseButton;
     148      Shift: TShiftState; X, Y: Integer);
     149    procedure pnlVisitMouseUp(Sender: TObject; Button: TMouseButton;
    145150      Shift: TShiftState; X, Y: Integer);
    146151    procedure mnuFileExitClick(Sender: TObject);
     
    225230    procedure ScreenActiveFormChange(Sender: TObject);
    226231    procedure AppEventsShortCut(var Msg: TWMKey; var Handled: Boolean);
    227     procedure mnuToolsClick(Sender: TObject);
    228232    procedure mnuToolsGraphingClick(Sender: TObject);
    229233    procedure pnlCIRNMouseDown(Sender: TObject; Button: TMouseButton;
     
    237241    procedure compAccessTabPageCaptionQuery(Sender: TObject;
    238242      var Text: string);
     243    procedure btnCombatVetClick(Sender: TObject);
    239244    procedure pnlVistaWebClick(Sender: TObject);
     245    procedure pnlVistaWebMouseUp(Sender: TObject; Button: TMouseButton;
     246      Shift: TShiftState; X, Y: Integer);
    240247    procedure pnlVistaWebMouseDown(Sender: TObject; Button: TMouseButton;
    241248      Shift: TShiftState; X, Y: Integer);
    242     procedure pnlVistaWebMouseUp(Sender: TObject; Button: TMouseButton;
     249    procedure mnuEditRedoClick(Sender: TObject);
     250    procedure tabPageMouseDown(Sender: TObject; Button: TMouseButton;
    243251      Shift: TShiftState; X, Y: Integer);
    244252  private
     
    334342      Shift: TShiftState; X, Y: Integer);
    335343  public
    336    EnduringPtSelSplitterPos, frmFrameHeight, pnlPatientSelectedHeight: integer;
     344    EnduringPtSelSplitterPos, frmFrameHeight, pnlPatientSelectedHeight: integer;
     345    EnduringPtSelColumns: string;
    337346    procedure SetBADxList;
    338347    procedure SetActiveTab(PageID: Integer);
     
    363372  frmFrame: TfrmFrame;
    364373  uTabList: TStringList;
    365   uRemoteType : string;
     374  uRemoteType, uReportID, uLabRepID : string;
    366375  FlaggedPTList: TStringList;
    367376  ctxContextor : TContextorControl;
    368   NextTab, LastTab: Integer;
    369   uToolsMaxed, uToolsWarned, uUseVistaWeb: boolean;
     377  NextTab, LastTab, ChangingTab: Integer;
     378  uUseVistaWeb: boolean;
     379  PTSwitchRefresh: boolean = FALSE;  //flag for patient refresh or switch of patients
     380  ProbTabClicked: boolean = FALSE;
     381  TabCtrlClicked: Boolean = FALSE;
    370382
    371383const
     
    390402  {$ENDIF}
    391403  , VA508AccessibilityRouter, fOtherSchedule, VAUtils, uVA508CPRSCompatibility, fIVRoutes,
    392   fPrintLocation, fTemplateEditor;
     404  fPrintLocation, fTemplateEditor, fTemplateDialog, fCombatVet;
    393405
    394406var                                 //  RV 05/11/04
     
    421433  FCP_FINISH  = 99;                             // form create finished successfully
    422434
    423   TX_IN_USE     = 'VistA CPRS in use by: ';
     435  TX_IN_USE     = 'VistA CPRS in use by: ';     // use same as with CPRSInstances in fTimeout
    424436  TX_OPTION     = 'OR CPRS GUI CHART';
    425437  TX_ECSOPT     = 'EC GUI CONTEXT';
     
    532544  else Application.ShowException(E);
    533545  Application.RestoreTopMosts;
     546end;
     547
     548procedure TfrmFrame.btnCombatVetClick(Sender: TObject);
     549begin
     550  inherited;
     551  frmCombatVet := TfrmCombatVet.Create(frmFrame);
     552  frmCombatVet.ShowModal;
     553  frmCombatVet.Free;
    534554end;
    535555
     
    617637  Changes.Clear;
    618638  lstCIRNLocations.Clear;
    619   uRemoteType := '';
    620639  ClearFlag;
    621640  if Assigned(FlagList) then FlagList.Clear;
     
    633652  if frmFrame.TimedOut then
    634653  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.'
     654    infoBox('CPRS has encountered a serious problem and is unable to display the selected patient''s data. '
    636655            + '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.'
    637656             + CRLF + CRLF + 'Please report all occurrences of this problem by contacting your CPRS Help Desk.', 'CPRS Error', MB_OK);
     
    664683{ Form Events (Create, Destroy) ----------------------------------------------------------- }
    665684
     685
    666686procedure TfrmFrame.RefreshFixedStatusWidth;
    667687begin
     
    675695  ClientVer, ServerVer, ServerReq: string;
    676696begin
    677   FProccessingNextClick := false;
    678697  FJustEnteredApp := false;
    679698  SizeHolder := TSizeHolder.Create;
     
    862881  GraphDataOnUser;
    863882  uRemoteType := '';
     883  uReportID := '';
     884  uLabRepID := '';
    864885  FPrevPtID := '';
    865886  SetUserTools;
    866887  EnduringPtSelSplitterPos := 0;
     888  EnduringPtSelColumns := '';
    867889  if User.IsReportsOnly then // Reports Only tab.
    868890    ReportsOnlyDisplay; // Calls procedure to hide all components/menus not needed.
     
    9861008procedure TfrmFrame.SetUserTools;
    9871009var
    988   ToolItems: TToolItemList;
    989   i: Integer;
     1010  item, parent: TToolMenuItem;
     1011  ok: boolean;
     1012  index, i, idx, count: Integer;
    9901013  UserTool: TMenuItem;
    991   MaxedOut: boolean;
     1014  Menus: TStringList;
    9921015  //  OptionsClick: TNotifyEvent;
    9931016begin
     
    10111034    //exit;
    10121035  end;
    1013   GetToolMenu(ToolItems, MaxedOut); // For all other users, proceed normally with creation of Tools menu:
    1014   for i := Low(ToolItems) to High(ToolItems) do
    1015   begin
    1016     if (AnsiCompareText(ToolItems[i].Caption, 'Event Capture Interface') = 0 ) and
     1036  GetToolMenu; // For all other users, proceed normally with creation of Tools menu:
     1037  for i := uToolMenuItems.Count-1 downto 0 do
     1038  begin
     1039    item := TToolMenuItem(uToolMenuItems[i]);
     1040    if (AnsiCompareText(item.Caption, 'Event Capture Interface') = 0 ) and
    10171041       (not uECSReport.ECSPermit) then
    10181042    begin
    1019       ToolItems[i].Caption := '';
    1020       ToolItems[i].Action  := '';
     1043      uToolMenuItems.Delete(i);
    10211044      Break;
    10221045    end;
    10231046  end;
    1024   if MaxedOut then
    1025   begin
    1026     uToolsMaxed := True;
    1027     uToolsWarned := False;
    1028   end;
    1029   for i := 0 to MAX_TOOLITEMS do with ToolItems[i] do if Length(Caption) > 0 then
    1030   begin
    1031     UserTool := TMenuItem.Create(Self);
    1032     UserTool.Caption := Caption;
    1033     UserTool.Hint := Action;
    1034     UserTool.OnClick := ToolClick;
    1035     mnuTools.Insert(i, UserTool);
    1036   end;
    1037 end;
    1038 
    1039 procedure TfrmFrame.mnuToolsClick(Sender: TObject);
    1040 const
    1041   TX_TOO_MANY_TOOLS = 'Some defined items may not be shown';
    1042   TC_TOO_MANY_TOOLS = 'Tool Menu Limit Exceeded';
    1043 begin
    1044   if uToolsMaxed and (not uToolsWarned) then
    1045   begin
    1046     InfoBox(TX_TOO_MANY_TOOLS, TC_TOO_MANY_TOOLS, MB_ICONWARNING or MB_OK);
    1047     uToolsWarned := True;
    1048   end;
     1047  Menus := TStringList.Create;
     1048  try
     1049    count := 0;
     1050    idx := 0;
     1051    index := 0;
     1052    while count < uToolMenuItems.Count do
     1053    begin
     1054      for I := 0 to uToolMenuItems.Count - 1 do
     1055      begin
     1056        item := TToolMenuItem(uToolMenuItems[i]);
     1057        if assigned(item.MenuItem) then continue;       
     1058        if item.SubMenuID = '' then
     1059          ok := True
     1060        else
     1061        begin
     1062          idx := Menus.IndexOf(item.SubMenuID);
     1063          ok := (idx >= 0);
     1064        end;
     1065        if ok then
     1066        begin
     1067          inc(count);
     1068          UserTool := TMenuItem.Create(Self);
     1069          UserTool.Caption := Item.Caption;
     1070          if Item.Action <> '' then
     1071          begin
     1072            UserTool.Hint := Item.Action;
     1073            UserTool.OnClick := ToolClick;
     1074          end;
     1075          Item.MenuItem := UserTool;
     1076          if item.SubMenuID = '' then
     1077          begin
     1078            mnuTools.Insert(Index,UserTool);
     1079            inc(Index);
     1080          end
     1081          else
     1082          begin
     1083            parent := TToolMenuItem(Menus.Objects[idx]);
     1084            parent.MenuItem.Add(UserTool);
     1085          end;
     1086          if item.MenuID <> '' then
     1087            Menus.AddObject(item.MenuID, item);
     1088        end;
     1089      end;
     1090    end;
     1091  finally
     1092    Menus.Free;
     1093  end;
     1094  FreeAndNil(uToolMenuItems);
    10491095end;
    10501096
     
    11681214  IsProgrammer: Boolean;
    11691215begin
    1170   IsProgrammer := User.HasKey('XUPROGMODE');
     1216  IsProgrammer := User.HasKey('XUPROGMODE') or (ShowRPCList = True);
    11711217  mnuHelpBroker.Visible  := IsProgrammer;
    11721218  mnuHelpLists.Visible   := IsProgrammer;
     
    12361282  if FLastPage = NewForm then
    12371283    begin
    1238       if Notifications.Active then PostMessage(Handle, UM_SHOWPAGE, 0, 0);
     1284      if Notifications.Active and Assigned(NewForm) then PostMessage(Handle, UM_SHOWPAGE, 0, 0);
    12391285      Exit;
    12401286    end;
     
    13191365  if ScreenReaderSystemActive and FCtrlTabUsed then
    13201366    SpeakPatient;
     1367  ChangingTab := PageID;
    13211368end;
    13221369
     
    13771424  begin
    13781425    ClearPatient;  // must be called to avoid leaving previous patient's information visible!
     1426    btnCombatVet.Caption := 'CV '+ CombatVet.ExpirationDate;
     1427    btnCombatVet.Visible := Patient.CombatVet.IsEligible;
    13791428    Visible := True;
    13801429    Application.ProcessMessages;
    1381     lblPtName.Caption := Name;
     1430    lblPtName.Caption := Name + Status; //CQ #17491: Allow for the display of the patient status indicator in header bar.
    13821431    lblPtSSN.Caption := SSN;
    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 //
     1432    lblPtAge.Caption := FormatFMDateTime('mmm dd,yyyy', DOB) + ' (' + IntToStr(Age) + ')';
    13881433    pnlPatient.Caption := lblPtName.Caption + ' ' + lblPtSSN.Caption + ' ' + lblPtAge.Caption;
    13891434    if Length(CWAD) > 0
     
    13961441    if Length(Attending) > 0 then lblPtAttending.Caption := 'Attending:  ' + MixedCase(Attending);
    13971442    pnlPrimaryCare.Caption := lblPtCare.Caption + ' ' + lblPtAttending.Caption;
     1443    if Length(Associate) > 0  then lblPtAttending.Caption := lblPtAttending.Caption + ' - Associate: ' + MixedCase(Associate);
     1444    pnlPrimaryCare.Caption := lblPtCare.Caption + ' ' + lblPtAttending.Caption ;
    13981445    SetUpCIRN;
    13991446    DisplayEncounterText;
     
    14511498begin
    14521499  DoNotChangeEncWindow := False;
     1500  OrderPrintForm := False;
    14531501  mnuFile.Tag := 0;
    14541502  SaveDFN := Patient.DFN;
     
    16511699  CCOWResponse: UserResponse;
    16521700begin
     1701  pnlPatient.Enabled := false;
     1702  if (Sender = mnuFileOpen) or (FRefreshing) then PTSwitchRefresh := True
     1703  else PTSwitchRefresh := False;  //part of a change to CQ #11529
    16531704  PtSelCancelled := FALSE;
    16541705  if not FRefreshing then mnuFile.Tag := 0
     
    16701721        PtEvtCompleted(TheCurrentView.EventDelay.PtEventIFN, TheCurrentView.EventDelay.EventName);
    16711722    end;*)
    1672   //if Sender <> mnuFileNext then     //CQ 16273 & 16419 - Missing Review/Sign changes dialog when clicking 'Next' button
    1673     if not AllowContextChangeAll(Reason) then Exit;
    1674      
     1723  //if Sender <> mnuFileNext then        //CQ 16273 & 16419 - Missing Review/Sign Changes dialog when clicking 'Next' button.
     1724    if not AllowContextChangeAll(Reason) then
     1725      begin
     1726        pnlPatient.Enabled := True;
     1727        Exit;
     1728      end;
    16751729  // update status text here
    16761730  stsArea.Panels.Items[1].Text := '';
     
    16851739        begin
    16861740          Notifications.Prior;
     1741          pnlPatient.Enabled := True;
    16871742          Exit;
    16881743        end;
     
    17281783        if (Patient.DFN = '') or (Sender = mnuFileOpen) or (Sender = mnuFileNext) or (Sender = mnuViewDemo) then
    17291784          SelectPatient(SHOW_NOTIFICATIONS, Font.Size, PtSelCancelled);
    1730         if PtSelCancelled then exit;
     1785        if PtSelCancelled then
     1786          begin
     1787            pnlPatient.Enabled := True;
     1788            exit;
     1789          end;
    17311790        ShowEverything;
    17321791        //HideEverything('Retrieving information - please wait....');  //v27 (pending) RV
     
    18111870 {End BillingAware}
    18121871 //ShowEverything;  //v27 (pending) RV
    1813  if not FRefreshing then DoNotChangeEncWindow := false;
     1872 if not FRefreshing then
     1873   begin
     1874      DoNotChangeEncWindow := false;
     1875      OrderPrintForm := false;
     1876      uCore.TempEncounterLoc := 0;
     1877      uCore.TempEncounterLocName := '';
     1878   end;
     1879 pnlPatient.Enabled := True;
    18141880 //frmCover.UpdateVAAButton; //VAA CQ7525   CQ#7933 - moved to SetupPatient, before event hook execution (RV)
    18151881end;
     
    18561922  EventChanges := False;
    18571923  NameNeedLook := '';
    1858   UpdatePtInfoOnRefresh;
     1924  //UpdatePtInfoOnRefresh;
    18591925  if Changes.Count > 0 then
    18601926  begin
     
    18721938  end
    18731939  else InfoBox('No new changes to review/sign.', 'Review Changes', MB_OK);
     1940  //CQ #17491: Moved UpdatePtInfoOnRefresh here to allow for the updating of the patient status indicator
     1941  //in the header bar (after the Review Changes dialog closes) if the patient becomes admitted/discharged.
     1942  UpdatePtInfoOnRefresh;
    18741943  FOrderPrintForm := false;
    18751944  FReviewClick := false;
     
    21442213end;
    21452214
     2215procedure TfrmFrame.pnlVisitMouseDown(Sender: TObject; Button: TMouseButton;
     2216  Shift: TShiftState; X, Y: Integer);
     2217{ emulate a button press in the encounter panel }
     2218begin
     2219  if User.IsReportsOnly then
     2220    exit;
     2221  if pnlVisit.BevelOuter = bvLowered then exit;
     2222  pnlVisit.BevelOuter := bvLowered;
     2223  //with lblStLocation do SetBounds(Left+2, Top+2, Width, Height);
     2224  with lblPtLocation do SetBounds(Left+2, Top+2, Width, Height);
     2225  with lblPtProvider do SetBounds(Left+2, Top+2, Width, Height);
     2226end;
     2227
     2228procedure TfrmFrame.pnlVisitMouseUp(Sender: TObject; Button: TMouseButton;
     2229  Shift: TShiftState; X, Y: Integer);
     2230{ emulate a button raising in the encounter panel and call Update Provider/Location }
     2231begin
     2232  if User.IsReportsOnly then
     2233    exit;
     2234  if pnlVisit.BevelOuter = bvRaised then exit;
     2235  pnlVisit.BevelOuter := bvRaised;
     2236  //with lblStLocation do SetBounds(Left-2, Top-2, Width, Height);
     2237  with lblPtLocation do SetBounds(Left-2, Top-2, Width, Height);
     2238  with lblPtProvider do SetBounds(Left-2, Top-2, Width, Height);
     2239end;
     2240
     2241procedure TfrmFrame.pnlVistaWebClick(Sender: TObject);
     2242begin
     2243  inherited;
     2244  uUseVistaWeb := true;
     2245  pnlVistaWeb.BevelOuter := bvLowered;
     2246  pnlCIRNClick(self);
     2247  uUseVistaWeb := false;
     2248end;
     2249
     2250procedure TfrmFrame.pnlVistaWebMouseDown(Sender: TObject; Button: TMouseButton;
     2251  Shift: TShiftState; X, Y: Integer);
     2252begin
     2253  inherited;
     2254  pnlVistaWeb.BevelOuter := bvLowered;
     2255end;
     2256
     2257procedure TfrmFrame.pnlVistaWebMouseUp(Sender: TObject; Button: TMouseButton;
     2258  Shift: TShiftState; X, Y: Integer);
     2259begin
     2260  inherited;
     2261  pnlVistaWeb.BevelOuter := bvRaised;
     2262end;
     2263
    21462264procedure TfrmFrame.pnlPrimaryCareMouseDown(Sender: TObject;
    21472265  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    21482266begin
     2267  if pnlPrimaryCare.BevelOuter = bvLowered then exit;
    21492268  pnlPrimaryCare.BevelOuter := bvLowered;
    21502269  with lblPtCare      do SetBounds(Left+2, Top+2, Width, Height);
     
    21552274  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    21562275begin
     2276  if pnlPrimaryCare.BevelOuter = bvRaised then exit;
    21572277  pnlPrimaryCare.BevelOuter := bvRaised;
    21582278  with lblPtCare      do SetBounds(Left-2, Top-2, Width, Height);
     
    21642284{ emulate a button press in the postings panel }
    21652285begin
     2286  if pnlPostings.BevelOuter = bvLowered then exit;
    21662287  pnlPostings.BevelOuter := bvLowered;
    21672288  with lblPtPostings do SetBounds(Left+2, Top+2, Width, Height);
     
    21732294{ emulate a button raising in the posting panel and call Postings }
    21742295begin
     2296  if pnlPostings.BevelOuter = bvRaised then exit;
    21752297  pnlPostings.BevelOuter := bvRaised;
    21762298  with lblPtPostings do SetBounds(Left-2, Top-2, Width, Height);
     
    22002322  SetUserColumns(TControl(frmMeds.hdrMedsIn));  // still need conversion
    22012323  SetUserColumns(TControl(frmMeds.hdrMedsOut));
     2324  SetUserString('frmPtSel.lstvAlerts',EnduringPtSelColumns);
     2325  SetUserString(SpellCheckerSettingName, SpellCheckerSettings);
    22022326  SetUserBounds2(TemplateEditorSplitters, tmplEditorSplitterMiddle,
    22032327                 tmplEditorSplitterProperties, tmplEditorSplitterMain, tmplEditorSplitterBoil);
     
    22122336  frmDCSumm.Drawers.LastOpenSize := s3;
    22132337
    2214   with frmMeds do                                           
     2338  with frmMeds do
    22152339     begin
    22162340     SetUserBounds2(frmMeds.Name+'Split', panelBottom, panelMedIn, Dummy, Dummy);
     
    22722396      Add(StrUserColumns(frmMeds.hdrMedsIn));
    22732397      Add(StrUserColumns(frmMeds.hdrMedsOut));
     2398      Add(StrUserString(SpellCheckerSettingName, SpellCheckerSettings));
    22742399      Add(StrUserBounds2(TemplateEditorSplitters, tmplEditorSplitterMiddle,
    22752400              tmplEditorSplitterProperties, tmplEditorSplitterMain, tmplEditorSplitterBoil));
     
    23082433      if EnduringPtSelSplitterPos <> 0 then
    23092434        Add(StrUserBounds2('frmPtSel.sptVert', EnduringPtSelSplitterPos, 0, 0, 0));
     2435      if EnduringPtSelColumns <> '' then
     2436        Add('C^frmPtSel.lstvAlerts^' + EnduringPtSelColumns);
    23102437    end;
    23112438    //Add sizes for forms that used SaveUserBounds() to save thier positions
     
    23812508      with lblCIRN       do Font.Size := NewFontSize;
    23822509      with lblVistaWeb   do Font.Size := NewFontSize;
    2383       with lstCIRNLocations do Font.Size := NewFontSize;
     2510      with lstCIRNLocations do
     2511        begin
     2512          Font.Size := NewFontSize;
     2513          ItemHeight := NewFontSize + 6;
     2514        end;
    23842515      with tabPage       do Font.Size := NewFontSize;
    23852516      with laMHV         do Font.Size := NewFontSize; //VAA
     
    24452576{ resizes and repositions the panels & labels used in the toolbar }
    24462577const
    2447 { TODO -oRV -cWVEHR Long Age : Change to 40, to fit long age }
    2448   //PATIENT_WIDTH = 29;
    2449   PATIENT_WIDTH = 40;
    2450 {}
     2578  PATIENT_WIDTH = 29;
    24512579  VISIT_WIDTH   = 36;
    24522580  POSTING_WIDTH = 11.5;
    24532581  FLAG_WIDTH    = 5;
     2582  CV_WIDTH      = 15; //14; WAT
    24542583  CIRN_WIDTH    = 11;
    24552584  MHV_WIDTH     = 6;
    2456 { TODO -oRV -cWVEHR Long Age : Change to 3 lines high, to fit long age }
    2457   //LINES_HIGH    = 2;
    2458   LINES_HIGH    = 3;
    2459 {}
     2585  LINES_HIGH    = 2;
    24602586  M_HORIZ       = 4;
    24612587  M_MIDDLE      = 2;
     
    24662592  //WidthNeeded: integer;
    24672593begin
    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 //
     2594  pnlToolbar.Height  := (LINES_HIGH * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ;
    24732595  pnlPatient.Width   := HigherOf(PATIENT_WIDTH * MainFontWidth, lblPtName.Width + (M_WVERT * 2));
    24742596  lblPtSSN.Top       := M_HORIZ + lblPtName.Height + M_MIDDLE;
    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 //
     2597  lblPtAge.Top       := lblPtSSN.Top;
     2598  lblPtAge.Left      := pnlPatient.Width - lblPtAge.Width - M_WVERT;
    24822599  pnlVisit.Width     := HigherOf(LowerOf(VISIT_WIDTH * MainFontWidth,
    24832600                                         HigherOf(lblPtProvider.Width + (M_WVERT * 2),
     
    24872604  lblPtAttending.Top := lblPtSSN.Top;
    24882605  pnlPostings.Width  := Round(POSTING_WIDTH * MainFontWidth);
    2489   pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
    2490   pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
     2606  if btnCombatVet.Visible then
     2607   begin
     2608    pnlCVnFlag.Width   := Round(CV_WIDTH * MainFontWidth);
     2609    pnlFlag.Width      := Round(CV_WIDTH * MainFontWidth);
     2610    btnCombatVet.Height := Round(pnlCVnFlag.Height div 2);
     2611   end
     2612  else
     2613   begin
     2614    pnlCVnFlag.Width   := Round(FLAG_WIDTH * MainFontWidth);
     2615    pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
     2616   end;
    24912617  pnlRemoteData.Width := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT;
    24922618  pnlVistaWeb.Height := pnlRemoteData.Height div 2;
     
    25612687    else if FEditCtrl is TRichEdit then IsReadOnly := TRichEdit(FEditCtrl).ReadOnly
    25622688    else IsReadOnly := True;
    2563     mnuEditUndo.Enabled := FEditCtrl.Perform(EM_CANUNDO, 0, 0) <> 0;
     2689
     2690    mnuEditRedo.Enabled := FEditCtrl.Perform(EM_CANREDO, 0, 0) <> 0;
     2691    mnuEditUndo.Enabled := (FEditCtrl.Perform(EM_CANUNDO, 0, 0) <> 0) and (FEditCtrl.Perform(EM_CANREDO, 0, 0) = 0);
     2692
    25642693    mnuEditCut.Enabled := FEditCtrl.SelLength > 0;
    25652694    mnuEditCopy.Enabled := mnuEditCut.Enabled;
     
    25782707  FEditCtrl.Perform(EM_UNDO, 0, 0);
    25792708end;
     2709
     2710procedure TfrmFrame.mnuEditRedoClick(Sender: TObject);
     2711begin
     2712  FEditCtrl.Perform(EM_REDO, 0, 0);
     2713end;
     2714
    25802715
    25812716procedure TfrmFrame.mnuEditCutClick(Sender: TObject);
     
    27792914    lblCIRN.Caption := ' Remote Data';
    27802915    lblCIRN.Alignment := taCenter;
     2916    pnlVistaWeb.BevelOuter := bvRaised;
    27812917    if RemoteDataExists and (RemoteSites.Count > 0) then
    27822918      begin
     
    27872923        lblCIRN.Caption := 'Remote Data';
    27882924        pnlCIRN.Hint := 'Click to display other facilities having data for this patient.';
     2925        lblVistaWeb.Font.Color := Get508CompliantColor(clBlue);
     2926        pnlVistaWeb.Hint := 'Click to go to VistaWeb to see data from other facilities for this patient.';
    27892927        if RemoteSites.Count > 0 then
    27902928          lstCIRNLocations.Items.Add('0' + U + 'All Available Sites');
     
    27992937      begin
    28002938        lblCIRN.Font.Color  := clWindowText;
     2939        lblVistaWeb.Font.Color := clWindowText;
    28012940        lblCIRN.Enabled     := False;
    28022941        pnlCIRN.TabStop     := False;
     
    30283167            TRemoteSite(Items[j]));
    30293168        end;
    3030 
    3031   if frmReports.tvReports.SelectionCount > 0 then frmReports.tvReportsClick(self);
    3032   if frmLabs.tvReports.SelectionCount > 0 then frmLabs.tvReportsClick(self);
     3169  //uReportID, uLabRepID = Report ID's set when report is selected (from file 101.24)
     3170  if not(Piece(uReportID,':',1) = 'OR_VWAL')
     3171    and not(Piece(uReportID,':',1) = 'OR_VWRX')
     3172    and not(Piece(uReportID,':',1) = 'OR_VWVS')
     3173    and (frmReports.tvReports.SelectionCount > 0) then frmReports.tvReportsClick(self);
     3174  if not(uLabRepID = '6:GRAPH') and not(uLabRepID = '5:WORKSHEET')
     3175    and not(uLabRepID = '4:SELECTED TESTS BY DATE')
     3176    and (frmLabs.tvReports.SelectionCount > 0) then frmLabs.tvReportsClick(self);
    30333177  //if frmLabs.lstReports.ItemIndex > -1 then frmLabs.ExtlstReportsClick(self, true);
    30343178  StatusText('');
     
    30623206  CurrPrt: string;
    30633207begin
    3064   CurrPrt := SelectDevice(Self, Encounter.Location, True,'');
     3208  CurrPrt := SelectDevice(Self, Encounter.Location, True, 'Print Device Selection');
    30653209  User.CurrentPrinter := Piece(CurrPrt, U, 1);
    30663210end;
     
    30683212procedure TfrmFrame.lstCIRNLocationsChange(Sender: TObject);
    30693213begin
    3070   if lstCIRNLocations.ItemIndex > 0 then
     3214  {if lstCIRNLocations.ItemIndex > 0 then
    30713215    if (lstCIRNLocations.Selected[lstCIRNLocations.ItemIndex] = true) and (uUpdateStat = false) then
    30723216      if not (piece(lstCIRNLocations.Items[1],'^',1) = '0') then
    30733217        lstCIRNLocations.OnClick(nil);
     3218  // Causing Access Violations}
    30743219end;
    30753220
     
    31583303begin
    31593304  FRefreshing := TRUE;
    3160 
    31613305  try
    31623306    mnuFileOpenClick(Self);
    31633307  finally
    31643308    FRefreshing := FALSE;
     3309    OrderPrintForm := FALSE;
    31653310  end;
    31663311end;
     
    31713316    FOldActivate(Sender);
    31723317  SetActiveWindow(Application.Handle);
    3173   if ScreenReaderSystemActive and assigned(Patient) and (Patient.Name <> '') then
     3318  if ScreenReaderSystemActive and assigned(Patient) and (Patient.Name <> '') and (Patient.Status <> '') then
    31743319      SpeakTabAndPatient;
    31753320end;
     
    33273472  uCore.TempEncounterDateTime := 0;
    33283473  uCore.TempEncounterVistCat := #0;
    3329   //ucore.TempOutEncounterLoc := 0;
    3330   //uCore.TempOutEncounterLocName := '';
    33313474  if (not FRefreshing) and (FReviewClick = false) then DoNotChangeEncWindow := false;
    33323475  if (FPrevInPatient and Patient.Inpatient) then                //transfering inside hospital
    33333476    begin
    3334      // if DoNotChangeEncWindow = false then
    3335      //   begin
    33363477          if FReviewClick = True then
    33373478            begin
     
    33543495              Exit;
    33553496            end;
    3356                
    3357             //end;
    3358           Encounter.Location := Patient.Location;
    3359        // end;
     3497          if orderprintform = false then Encounter.Location := Patient.Location;
    33603498    end
    33613499  else if (FPrevInPatient and (not Patient.Inpatient)) then     //patient was discharged
     
    33643502    Encounter.Location := 0;
    33653503    FPrevInPatient := False;
     3504    lblPtName.Caption := '';
     3505    lblPtName.Caption := Patient.Name + Patient.Status; //CQ #17491: Refresh patient status indicator in header bar on discharge.
    33663506  end
    33673507  else if ((not FPrevInPatient) and Patient.Inpatient) then     //patient was admitted
     
    33733513    uCore.TempEncounterDateTime := Encounter.DateTime;
    33743514    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)
     3515    lblPtName.Caption := '';
     3516    lblPtName.Caption := Patient.Name + Patient.Status; //CQ #17491: Refresh patient status indicator in header bar on admission.
     3517    if (FReviewClick = False) and (encounter.Location <> patient.Location) and (OrderPrintForm = false) then
     3518        begin
     3519          frmPrintLocation.SwitchEncounterLoction(Encounter.Location, Encounter.locationName, Encounter.LocationText,
     3520                                                Encounter.DateTime, Encounter.VisitCategory);
     3521          //agp values are reset depending on the user process
     3522          uCore.TempEncounterLoc := 0;  //hds7591  Clinic/Ward movement.
     3523          uCore.TempEncounterLocName := ''; //hds7591  Clinic/Ward movement.
     3524          uCore.TempEncounterText := '';
     3525          uCore.TempEncounterDateTime := 0;
     3526          uCore.TempEncounterVistCat := #0;
     3527        end
    33783528    else
    3379     //if DoNotChangeEncWindow = false then
     3529    if OrderPrintForm = false then
    33803530      begin
    33813531        Encounter.Location := Patient.Location;
     
    34633613procedure TfrmFrame.pnlPatientClick(Sender: TObject);
    34643614begin
     3615  Screen.Cursor := crHourglass; //wat cq 18425 added hourglass and disabled mnuFileOpen
     3616  mnuFileOpen.Enabled := False;
     3617  try
    34653618  pnlPatient.Enabled := false;
    34663619  ViewInfo(mnuViewDemo);
    34673620  pnlPatient.Enabled := true;
     3621  finally
     3622    Screen.Cursor := crDefault;
     3623    mnuFileOpen.Enabled := True;
     3624  end;
    34683625end;
    34693626
    34703627procedure TfrmFrame.pnlVisitClick(Sender: TObject);
    34713628begin
    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 
     3629 //if (not User.IsReportsOnly) then // Reports Only tab.
     3630 //  mnuFileEncounterClick(Self);
    34773631  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;
    35053632end;
    35063633
     
    41794306  pnlFlag.BevelInner := bvRaised;
    41804307  pnlFlag.BevelOuter := bvNone;
    4181   pnlFlag.BevelWidth := 4;
     4308  pnlFlag.BevelWidth := 3;
    41824309end;
    41834310
     
    41874314  pnlFlag.BevelInner := bvNone;
    41884315  pnlFlag.BevelOuter := bvRaised;
     4316end;
     4317
     4318procedure TfrmFrame.tabPageMouseDown(Sender: TObject; Button: TMouseButton;
     4319  Shift: TShiftState; X, Y: Integer);
     4320begin
     4321  inherited;
     4322  TabCtrlClicked := True;
    41894323end;
    41904324
     
    43564490  ReportString: TStringList;
    43574491  aAddress: string;
    4358 
    43594492begin
    43604493  case (Sender as TMenuItem).Tag of
     
    43954528        if uUseVistaWeb = true then
    43964529          begin
    4397             pnlCIRN.BevelOuter := bvRaised;
    43984530            lblCIRN.Alignment := taCenter;
    43994531            lstCIRNLocations.Visible := false;
     
    44014533            aAddress := GetVistaWebAddress(Patient.DFN);
    44024534            ShellExecute(pnlCirn.Handle, 'open', PChar(aAddress), PChar(''), '', SW_NORMAL);
     4535            pnlCIRN.BevelOuter := bvRaised;
    44034536            Exit;
    44044537          end;
Note: See TracChangeset for help on using the changeset viewer.