Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/fNotes.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/fNotes.pas
r459 r460 1 1 unit fNotes; 2 2 {$O-} 3 {4 NOTES:5 TAB ORDER:6 Becuase of the Dynamic ways of this form, the tab order must be7 coded into the onExit events of the controls. If a new control is8 added that needs access with tab & shift tab you must add the9 code. Right clicking on the form and selecting tab order will not10 be sufficient. See TfrmNotes.memPCEShowExit procedure for example.11 }12 3 13 4 interface … … 16 7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 17 8 fHSplit, StdCtrls, ExtCtrls, Menus, ComCtrls, ORCtrls, ORFn, uConst, ORDtTm, 18 uPCE, ORClasses, fDrawers, ImgList, rTIU, uTIU, uDocTree, fRptBox, fPrintList; 9 uPCE, ORClasses, fDrawers, ImgList, rTIU, uTIU, uDocTree, fRptBox, fPrintList, 10 fNoteST, ORNet, fNoteSTStop; 19 11 20 12 type … … 116 108 N3: TMenuItem; 117 109 mnuEditDialgFields: TMenuItem; 110 tvNotes: TORTreeView; 118 111 lvNotes: TCaptionListView; 119 112 sptList: TSplitter; … … 143 136 popNoteMemoInsTemplate: TMenuItem; 144 137 popNoteMemoEncounter: TMenuItem; 145 tvNotes: TORTreeView; 138 mnuSearchForText: TMenuItem; 139 popSearchForText: TMenuItem; 140 mnuViewInformation: TMenuItem; 141 mnuViewDemo: TMenuItem; 142 mnuViewVisits: TMenuItem; 143 mnuViewPrimaryCare: TMenuItem; 144 mnuViewMyHealtheVet: TMenuItem; 145 mnuInsurance: TMenuItem; 146 mnuViewFlags: TMenuItem; 147 mnuViewReminders: TMenuItem; 148 mnuViewRemoteData: TMenuItem; 149 mnuViewPostings: TMenuItem; 146 150 procedure mnuChartTabClick(Sender: TObject); 147 151 procedure lstNotesClick(Sender: TObject); … … 214 218 procedure dlgReplaceTextFind(Sender: TObject); 215 219 procedure mnuActAttachtoIDParentClick(Sender: TObject); 216 procedure memNewNoteKeyDown(Sender: TObject; var Key: Word; 217 Shift: TShiftState); 220 procedure memNewNoteKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 218 221 procedure sptHorzCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); 219 222 procedure popNoteMemoInsTemplateClick(Sender: TObject); … … 222 225 procedure tvNotesDeletion(Sender: TObject; Node: TTreeNode); 223 226 procedure tvNotesExit(Sender: TObject); 227 procedure pnlReadExit(Sender: TObject); 224 228 procedure cmdNewNoteExit(Sender: TObject); 225 229 procedure FormHide(Sender: TObject); 226 230 procedure FormShow(Sender: TObject); 231 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, 232 Y: Integer); 227 233 procedure memNewNoteKeyPress(Sender: TObject; var Key: Char); 228 234 procedure memNewNoteKeyUp(Sender: TObject; var Key: Word; … … 231 237 procedure cmdChangeExit(Sender: TObject); 232 238 procedure cmdPCEExit(Sender: TObject); 233 procedure memNoteExit(Sender: TObject);234 procedure lvNotesExit(Sender: TObject);239 procedure ViewInfo(Sender: TObject); 240 procedure mnuViewInformationClick(Sender: TObject); 235 241 private 236 242 FNavigatingTab : Boolean; //Currently Using tab to navigate … … 255 261 FOldDrawerPnlEncounterButtonExit: TNotifyEvent; 256 262 FOldDrawerEdtSearchExit: TNotifyEvent; 263 FMousing: TDateTime; 257 264 FStarting: boolean; 258 265 procedure frmFramePnlPatientExit(Sender: TObject); … … 261 268 procedure frmDrawerEdtSearchExit(Sender: TObject); 262 269 procedure ClearEditControls; 263 procedure DoAutoSave ;270 procedure DoAutoSave(Suppress: integer = 1); 264 271 function GetTitleText(AnIndex: Integer): string; 265 272 procedure InsertAddendum; … … 310 317 var 311 318 frmNotes: TfrmNotes; 319 SearchTextStopFlag: Boolean; // Text Search CQ: HDS00002856 312 320 313 321 implementation … … 389 397 ' but will remain indefinitely discoverable to HIMS.' +CRLF +CRLF; 390 398 TX_AUTH_SIGNED = 'Author has not signed, are you SURE you want to sign.' +CRLF; 391 399 { 400 type 401 //CQ8300 402 ClipboardData = record 403 Text: array[0..255] of char; 404 end; 405 } 392 406 var 393 407 uPCEShow, uPCEEdit: TPCEData; … … 399 413 uChanging: Boolean; 400 414 uIDNotesActive: Boolean; 415 401 416 402 417 { TPage common methods --------------------------------------------------------------------- } … … 631 646 {LastCosigner & LastCosignerName aren't cleared because they're used as default for next note.} 632 647 Lines := nil; 648 PRF_IEN := 0; 649 ActionIEN := ''; 633 650 end; 634 651 // clear the editing controls (also clear the new labels?) 635 652 txtSubject.Text := ''; 636 memNewNote.Clear;653 if memNewNote <> nil then memNewNote.Clear; //CQ7012 Added test for nil 637 654 timAutoSave.Enabled := False; 638 655 // clear the PCE object for editing … … 754 771 if IsConsultTitle(Title) and (PkgIEN = 0) then Result := True; 755 772 if IsSurgeryTitle(Title) and (PkgIEN = 0) then Result := True; 773 if IsPRFTitle(Title) and (PRF_IEN = 0) and (not DocType = TYP_ADDENDUM) then Result := True; 756 774 if (DocType = TYP_ADDENDUM) then 757 775 begin … … 760 778 begin 761 779 if Title > 0 then CurTitle := Title else CurTitle := DocType; 762 if AskCosignerForTitle(CurTitle, Author ) and (Cosigner <= 0) then Result := True;780 if AskCosignerForTitle(CurTitle, Author, DateTime) and (Cosigner <= 0) then Result := True; 763 781 end; 764 782 end; … … 897 915 x, WhyNot, DocInfo: string; 898 916 begin 917 if frmFrame.Timedout then Exit; 918 899 919 FNewIDChild := IsIDChild; 900 920 EnableAutosave := FALSE; … … 932 952 end; 933 953 // check to see if interaction necessary to get required fields 934 if LacksRequiredForCreate or VerifyNoteTitle or UnresolvedConsultsExist 954 GetUnresolvedConsultsInfo; 955 if LacksRequiredForCreate or VerifyNoteTitle or uUnresolvedConsults.UnresolvedConsultsExist 935 956 then HaveRequired := ExecuteNoteProperties(FEditNote, CT_NOTES, IsIDChild, FNewIDChild, '', 0) 936 957 else HaveRequired := True; … … 953 974 //7348^Note Title^3000913^NERD, YOURA (N0165)^1329;Rich Vertigan;VERTIGAN,RICH^8E REHAB MED^complete^Adm: 11/05/98;2981105.095547^ ;^^0^^^2 954 975 with FEditNote do 955 begin 956 x := IntToStr(CreatedNote.IEN) + U + TitleName + U + FloatToStr(FEditNote.DateTime) + U + 957 Patient.Name + U + IntToStr(Author) + ';' + AuthorName + U + LocationName + U + 'new' + U + 958 U + U + U + U + U + U + U; 959 end; 976 begin 977 x := IntToStr(CreatedNote.IEN) + U + TitleName + U + FloatToStr(FEditNote.DateTime) + U + 978 Patient.Name + U + IntToStr(Author) + ';' + AuthorName + U + LocationName + U + 'new' + U + 979 U + U + U + U + U + U + U; 980 //Link Note to PRF Action 981 if PRF_IEN <> 0 then 982 if sCallV('TIU LINK TO FLAG', [CreatedNote.IEN,PRF_IEN,ActionIEN,Patient.DFN]) = '0' then 983 ShowMessage('TIU LINK TO FLAG: FAILED'); 984 end; 960 985 961 986 lstNotes.Items.Insert(0, x); … … 995 1020 FChanged := False; 996 1021 cmdChangeClick(Self); // will set captions, sign state for Changes 997 lstNotesClick(Self); // will make pnlWrite visible1022 lstNotesClick(Self); // will make pnlWrite visible 998 1023 if timAutoSave.Interval <> 0 then EnableAutosave := TRUE; 999 1024 if txtSubject.Visible then txtSubject.SetFocus else memNewNote.SetFocus; … … 1065 1090 else HaveRequired := True; 1066 1091 // lock the consult request if there is a consult 1067 with FEditNote do if (PkgIEN > 0) and (PkgPtr = PKG_CONSULTS) then HaveRequired := LockConsultRequest(PkgIEN); 1092 if HaveRequired then 1093 with FEditNote do 1094 if (PkgIEN > 0) and (PkgPtr = PKG_CONSULTS) then HaveRequired := LockConsultRequest(PkgIEN); 1068 1095 if HaveRequired then 1069 1096 begin … … 1285 1312 inherited; 1286 1313 LimitEditWidth(memNewNote, MAX_PROGRESSNOTE_WIDTH - 1); 1287 memNewNote.Constraints.MinWidth := TextWidthByFont(memNewNote.Font.Handle, StringOfChar('X', MAX_PROGRESSNOTE_WIDTH)) + (LEFT_MARGIN * 2) + ScrollBarWidth; 1288 pnlLeft.Width := self.ClientWidth - pnlWrite.Width - sptHorz.Width; 1314 1315 //CQ7012 Added test for nil 1316 if memNewNote <> nil then 1317 memNewNote.Constraints.MinWidth := TextWidthByFont(memNewNote.Font.Handle, StringOfChar('X', MAX_PROGRESSNOTE_WIDTH)) + (LEFT_MARGIN * 2) + ScrollBarWidth; 1318 //CQ7012 Added test for nil 1319 if (Self <> nil) and (pnlLeft <> nil) and (pnlWrite <> nil) and (sptHorz <> nil) then 1320 pnlLeft.Width := self.ClientWidth - pnlWrite.Width - sptHorz.Width; 1289 1321 end; 1290 1322 … … 1395 1427 // no other note being edited, so just proceed as before. 1396 1428 UpdateEncounterInfo; 1397 cmdPCE.Enabled := TRUE; 1429 if cmdPCE <> nil then 1430 cmdPCE.Enabled := TRUE 1398 1431 end; 1399 1432 … … 1466 1499 OKPressed, IsIDChild: Boolean; 1467 1500 x: string; 1501 DisAssoText : String; 1468 1502 begin 1469 1503 inherited; … … 1471 1505 LastTitle := FEditNote.Title; 1472 1506 FEditNote.IsNewNote := False; 1507 DisAssoText := ''; 1508 if (FEditNote.PkgPtr = PKG_CONSULTS) then 1509 DisAssoText := 'Consults'; 1510 if (FEditNote.PkgPtr = PKG_PRF) then 1511 DisAssoText := 'Patient Record Flags'; 1512 if (DisAssoText <> '') and (Sender <> Self) then 1513 if InfoBox('If this title is changed, Any '+DisAssoText+' will be disassociated'+ 1514 ' with this note', 1515 'Disassociate '+DisAssoText+'?',MB_OKCANCEL) = IDCANCEL then 1516 exit; 1473 1517 if FEditNote.PkgPtr = PKG_CONSULTS then LastConsult := FEditNote.PkgIEN else LastConsult := 0;; 1474 1518 if Sender <> Self then OKPressed := ExecuteNoteProperties(FEditNote, CT_NOTES, IsIDChild, FNewIDChild, '', 0) … … 1500 1544 lstNotes.Items[EditingIndex] := x; 1501 1545 Changes.ReplaceText(CH_DOC, lstNotes.ItemID, GetTitleText(EditingIndex)); 1502 with FEditNote do if (PkgPtr = PKG_CONSULTS) and (LastConsult <> PkgIEN) then 1546 with FEditNote do 1547 begin 1548 if (PkgPtr = PKG_CONSULTS) and (LastConsult <> PkgIEN) then 1503 1549 begin 1504 1550 // try to lock the new consult, reset to previous if unable … … 1514 1560 end; 1515 1561 end; 1562 //Link Note to PRF Action 1563 if PRF_IEN <> 0 then 1564 if sCallV('TIU LINK TO FLAG', [lstNotes.ItemIEN,PRF_IEN,ActionIEN,Patient.DFN]) = '0' then 1565 ShowMessage('TIU LINK TO FLAG: FAILED'); 1566 end; 1567 1516 1568 if LastTitle <> FEditNote.Title then mnuActLoadBoilerClick(Self); 1517 1569 end; … … 1532 1584 end; 1533 1585 1534 procedure TfrmNotes.DoAutoSave ;1586 procedure TfrmNotes.DoAutoSave(Suppress: integer = 1); 1535 1587 var 1536 1588 ErrMsg: string; … … 1542 1594 timAutoSave.Enabled := False; 1543 1595 try 1544 SetText(ErrMsg, memNewNote.Lines, lstNotes.GetIEN(EditingIndex), 1);1596 SetText(ErrMsg, memNewNote.Lines, lstNotes.GetIEN(EditingIndex), Suppress); 1545 1597 finally 1546 1598 timAutoSave.Enabled := True; … … 1566 1618 var 1567 1619 AuthCtxt: TAuthorContext; 1620 SearchCtxt: TSearchContext; // Text Search CQ: HDS00002856 1568 1621 DateRange: TNoteDateRange; 1569 1622 Saved: Boolean; … … 1602 1655 LoadNotes; 1603 1656 end; 1657 // Text Search CQ: HDS00002856 -------------------- 1658 NC_SEARCHTEXT: begin; 1659 SearchTextStopFlag := False; 1660 SelectSearchText(Font.Size, FCurrentContext.SearchString, SearchCtxt ); 1661 with SearchCtxt do if Changed then 1662 begin 1663 //FCurrentContext.Status := IntToStr(ViewContext); 1664 frmSearchStop.Show; 1665 lblNotes.Caption := 'Search: '+ SearchString; 1666 frmSearchStop.lblSearchStatus.Caption := lblNotes.Caption; 1667 FCurrentContext.SearchString := SearchString; 1668 LoadNotes; 1669 end; 1670 // Only do LoadNotes if something changed 1671 end; 1672 // Text Search CQ: HDS00002856 -------------------- 1604 1673 NC_UNCOSIGNED: begin 1605 1674 FillChar(FCurrentContext, SizeOf(FCurrentContext), 0); … … 1667 1736 end; {case} 1668 1737 lblNotes.Caption := SetNoteTreeLabel(FCurrentContext); 1738 // Text Search CQ: HDS00002856 -------------------- 1739 If FCurrentContext.SearchString <> '' then 1740 lblNotes.Caption := lblNotes.Caption+', containing "'+FCurrentContext.SearchString+'"'; 1741 If SearchTextStopFlag=True then begin; 1742 lblNotes.Caption := 'Search for "'+FCurrentContext.SearchString+'" was stopped!'; 1743 end; 1744 frmSearchStop.Hide; 1745 // Text Search CQ: HDS00002856 -------------------- 1669 1746 lblNotes.hint := lblNotes.Caption; 1670 1747 tvNotes.Caption := lblNotes.Caption; … … 2128 2205 procedure TfrmNotes.SaveSignItem(const ItemID, ESCode: string); 2129 2206 { saves and optionally signs a progress note or addendum } 2207 const 2208 SIG_COSIGN = 'COSIGNATURE'; 2209 SIG_SIGN = 'SIGNATURE'; 2130 2210 var 2131 2211 AnIndex, IEN, i: Integer; 2132 2212 Saved, ContinueSign: Boolean; {*RAB* 8/26/99} 2133 SignSts: TActionRec;2213 ActionSts, SignSts: TActionRec; 2134 2214 APCEObject: TPCEData; 2135 2215 OK: boolean; 2136 2216 ActionType, SignTitle: string; 2137 2217 begin 2138 2218 AnIndex := -1; … … 2159 2239 if Length(ESCode) > 0 then 2160 2240 begin 2161 if not NoteHasText(IEN) then 2241 if CosignDocument(IEN) then 2242 begin 2243 SignTitle := TX_COSIGN; 2244 ActionType := SIG_COSIGN; 2245 end else 2246 begin 2247 SignTitle := TX_SIGN; 2248 ActionType := SIG_SIGN; 2249 end; 2250 ActOnDocument(ActionSts, IEN, ActionType); 2251 if not ActionSts.Success then 2252 begin 2253 InfoBox(ActionSts.Reason, TX_IN_AUTH, MB_OK); 2254 ContinueSign := False; 2255 end 2256 else if not NoteHasText(IEN) then 2162 2257 begin 2163 2258 InfoBox(TX_EMPTY_NOTE1, TC_EMPTY_NOTE, MB_OK or MB_ICONERROR); … … 2276 2371 2277 2372 procedure TfrmNotes.popNoteMemoFindClick(Sender: TObject); 2373 //var 2374 //hData: THandle; //CQ8300 2375 //pData: ^ClipboardData; //CQ8300 2278 2376 begin 2279 2377 inherited; … … 2284 2382 FindText := ''; 2285 2383 Options := [frDown, frHideUpDown]; 2384 { 2385 //CQ8300 2386 OpenClipboard(dlgFindText.Handle); 2387 hData := GetClipboardData(CF_TEXT); 2388 pData := GlobalLock(hData); 2389 FindText := pData^.Text; 2390 GlobalUnlock(hData); 2391 CloseClipboard; 2392 //end CQ8300 2393 } 2286 2394 Execute; 2287 2395 end; … … 2322 2430 begin 2323 2431 inherited; 2324 DoAutoSave ;2432 DoAutoSave(0); 2325 2433 timAutoSave.Enabled := False; 2326 2434 try 2327 2435 SpellCheckForControl(memNewNote); 2328 2436 finally 2437 FChanged := True; 2438 DoAutoSave(0); 2329 2439 timAutoSave.Enabled := True; 2330 2440 end; … … 2334 2444 begin 2335 2445 inherited; 2336 DoAutoSave ;2446 DoAutoSave(0); 2337 2447 timAutoSave.Enabled := False; 2338 2448 try 2339 2449 GrammarCheckForControl(memNewNote); 2340 2450 finally 2451 FChanged := True; 2452 DoAutoSave(0); 2341 2453 timAutoSave.Enabled := True; 2342 2454 end; … … 2399 2511 SigAction: integer; 2400 2512 SavedDocID: string; 2513 ARefDate: TFMDateTime; 2401 2514 begin 2402 2515 inherited; … … 2432 2545 if not LockConsultRequestAndNote(lstNotes.ItemIEN) then Exit; 2433 2546 Exclusions := GetCurrentSigners(lstNotes.ItemIEN); 2434 SelectAdditionalSigners(Font.Size, lstNotes.ItemIEN, SigAction, Exclusions, SignerList, CT_NOTES); 2547 ARefDate := StrToFloat(Piece(lstNotes.Items[lstNotes.ItemIndex], U, 3)); 2548 SelectAdditionalSigners(Font.Size, lstNotes.ItemIEN, SigAction, Exclusions, SignerList, CT_NOTES, ARefDate); 2435 2549 with SignerList do 2436 2550 begin … … 2713 2827 //=================== Added for sort/search enhancements ====================== 2714 2828 procedure TfrmNotes.LoadNotes; 2829 const 2830 INVALID_ID = -1; 2831 INFO_ID = 1; 2715 2832 var 2716 2833 tmpList: TStringList; 2717 2834 ANode: TORTreeNode; 2835 x,xx,noteId: integer; // Text Search CQ: HDS00002856 2836 Dest: TStrings; // Text Search CQ: HDS00002856 2837 KeepFlag: Boolean; // Text Search CQ: HDS00002856 2838 NoteCount, NoteMatches: integer; // Text Search CQ: HDS00002856 2718 2839 begin 2719 2840 tmpList := TStringList.Create; … … 2759 2880 ListNotesForTree(tmpList, StrToIntDef(Status, 0), FMBeginDate, FMEndDate, Author, MaxDocs, TreeAscending); 2760 2881 CreateListItemsforDocumentTree(FDocList, tmpList, StrToIntDef(Status, 0), GroupBy, TreeAscending, CT_NOTES); 2882 2883 // Text Search CQ: HDS00002856 --------------------------------------- 2884 if FCurrentContext.SearchString<>'' then // Text Search CQ: HDS00002856 2885 begin 2886 NoteMatches := 0; 2887 Dest:=TStringList.Create; 2888 NoteCount:=FDocList.Count-1; 2889 if FDocList.Count>0 then 2890 for x := FDocList.Count-1 downto 1 do begin; // Don't do 0, because it's informational 2891 KeepFlag:=False; 2892 lblNotes.Caption:='Scanning '+IntToStr(NoteCount-x+1)+' of '+IntToStr(NoteCount)+', '+IntToStr(NoteMatches); 2893 If NoteMatches=1 then lblNotes.Caption:=lblNotes.Caption+' match' else 2894 lblNotes.Caption:=lblNotes.Caption+' matches'; 2895 frmSearchStop.lblSearchStatus.Caption := lblNotes.Caption; 2896 frmSearchStop.lblSearchStatus.Repaint; 2897 lblNotes.Repaint; 2898 // Free up some ticks so they can click the "Stop" button 2899 application.processmessages; 2900 application.processmessages; 2901 application.processmessages; 2902 If SearchTextStopFlag = False then begin 2903 noteId := StrToIntDef(Piece(FDocList.Strings[x],'^',1),-1); 2904 if (noteId = INVALID_ID) or (noteId = INFO_ID) then 2905 Continue; 2906 CallV('TIU GET RECORD TEXT', [Piece(FDocList.Strings[x],'^',1)]); 2907 Dest.Assign(RPCBrokerV.Results); 2908 If Dest.Count > 0 then 2909 for xx := 0 to Dest.Count-1 do 2910 begin 2911 //Dest.Strings[xx] := StringReplace(Dest.Strings[xx],'#13',' ',[rfReplaceAll, rfIgnoreCase]); 2912 if Pos(Uppercase(FCurrentContext.SearchString),Uppercase(Dest.Strings[xx]))>0 then 2913 keepflag:=true; 2914 end; 2915 If KeepFlag=False then begin; 2916 if FDocList.Count >= x then 2917 FDocList.Delete(x); 2918 if (tmpList.Count >= x) and (x > 0) then 2919 tmpList.Delete(x-1); 2920 end else 2921 Inc(NoteMatches); 2922 end; 2923 end; 2924 Dest.Free; 2925 end; 2926 // Text Search CQ: HDS00002856 --------------------------------------- 2927 2761 2928 UpdateTreeView(FDocList, tvNotes); 2762 2929 end; … … 3096 3263 var 3097 3264 WhyNot: string; 3265 //Saved: boolean; 3098 3266 begin 3099 3267 if EditingIndex <> -1 then … … 3213 3381 procedure TfrmNotes.ShowPCEButtons(Editing: boolean); 3214 3382 begin 3383 if frmFrame.Timedout then Exit; 3384 3215 3385 FEditingNotePCEObj := Editing; 3216 3386 if Editing or AnytimeEncounters then … … 3424 3594 SetPiece(x, U, 5, NewAuth + ';' + AuthNameCheck); 3425 3595 lstNotes.Items[EditingIndex] := x; 3426 if AskCosignerForTitle(Title, Author ) then3596 if AskCosignerForTitle(Title, Author, DateTime) then 3427 3597 begin 3428 3598 InfoBox(UpperCase(AuthNameCheck) + TX_COSIGNER_REQD, TC_COSIGNER_REQD, MB_OK); … … 3495 3665 procedure TfrmNotes.tvNotesExit(Sender: TObject); 3496 3666 begin 3497 if Boolean(Hi(GetKeyState(VK_TAB))) and (not Boolean(Hi(GetKeyState(VK_SHIFT))))then3667 if IncSecond(FMousing,1) < Now then 3498 3668 begin 3499 3669 if (Screen.ActiveControl = frmDrawers.pnlTemplatesButton) or … … 3503 3673 FindNextControl( cmdPCE, True, True, False).SetFocus; 3504 3674 end; 3675 FMousing := 0; 3676 end; 3677 3678 procedure TfrmNotes.pnlReadExit(Sender: TObject); 3679 begin 3680 inherited; 3681 if IncSecond(FMousing,1) < Now then 3682 begin 3683 if (Screen.ActiveControl = frmFrame.pnlPatient) then 3684 FindNextControl( tvNotes, True, True, False).SetFocus 3685 else 3686 if (Screen.ActiveControl = frmDrawers.pnlTemplatesButton) or 3687 (Screen.ActiveControl = frmDrawers.pnlEncounterButton) or 3688 (Screen.ActiveControl = cmdNewNote) or 3689 (Screen.ActiveControl = cmdPCE) then 3690 FindNextControl( frmDrawers.pnlTemplatesButton, False, True, False).SetFocus; 3691 end; 3692 FMousing := 0; 3505 3693 end; 3506 3694 … … 3508 3696 begin 3509 3697 inherited; 3510 if Boolean(Hi(GetKeyState(VK_TAB))) and3511 (not frmDrawers.pnlEncounterButton.CanFocus) and3512 (not Boolean(Hi(GetKeyState(VK_SHIFT)))) then3513 if (memPCEShow.CanFocus) then3514 memPCEShow.SetFocus3698 if IncSecond(FMousing,1) < Now then 3699 begin 3700 if (Screen.ActiveControl = lvNotes) or 3701 (Screen.ActiveControl = memNote) then 3702 frmFrame.pnlPatient.SetFocus 3515 3703 else 3516 frmFrame.pnlPatient.SetFocus; 3704 if (Screen.ActiveControl = tvNotes) then 3705 FindNextControl( frmFrame.pnlPatient, False, True, False).SetFocus; 3706 end; 3707 FMousing := 0; 3517 3708 end; 3518 3709 … … 3520 3711 begin 3521 3712 FOldFramePnlPatientExit(Sender); 3522 if Boolean(Hi(GetKeyState(VK_TAB)))then3713 if IncSecond(FMousing,1) < Now then 3523 3714 begin 3524 3715 if (Screen.ActiveControl = lvNotes) or … … 3526 3717 FindNextControl( lvNotes, False, True, False).SetFocus; 3527 3718 end; 3719 FMousing := 0; 3528 3720 end; 3529 3721 … … 3559 3751 begin 3560 3752 FOldDrawerPnlTemplatesButtonExit(Sender); 3561 if Boolean(Hi(GetKeyState(VK_TAB))) and Boolean(Hi(GetKeyState(VK_SHIFT))) then3562 if memNewNote.CanFocusthen3563 3564 else if memNote.CanFocus then3565 memNote.SetFocus;3753 if Boolean(Hi(GetKeyState(VK_TAB))) and (memNewNote.CanFocus) and 3754 Boolean(Hi(GetKeyState(VK_SHIFT))) then 3755 memNewNote.SetFocus 3756 else 3757 cmdNewNoteExit(Sender); 3566 3758 end; 3567 3759 … … 3570 3762 FOldDrawerPnlEncounterButtonExit(Sender); 3571 3763 cmdNewNoteExit(Sender); 3764 end; 3765 3766 procedure TfrmNotes.FormMouseMove(Sender: TObject; Shift: TShiftState; X, 3767 Y: Integer); 3768 begin 3769 inherited; 3770 FMousing := Now; 3572 3771 end; 3573 3772 … … 3606 3805 if Boolean(Hi(GetKeyState(VK_TAB))) then 3607 3806 if Boolean(Hi(GetKeyState(VK_SHIFT))) then 3608 if cmdPCE.CanFocus then 3609 cmdPCE.SetFocus 3610 else 3611 cmdNewNote.SetFocus 3807 cmdPCE.SetFocus 3612 3808 else 3613 3809 frmFrame.pnlPatient.SetFocus; … … 3629 3825 if Boolean(Hi(GetKeyState(VK_TAB))) and 3630 3826 Not Boolean(Hi(GetKeyState(VK_SHIFT))) then 3631 memPCEShow.SetFocus; 3632 end; 3633 3634 procedure TfrmNotes.memNoteExit(Sender: TObject); 3635 begin 3636 inherited; 3637 //Fix the Tab Order Make Drawers Buttons Accessible 3638 if Boolean(Hi(GetKeyState(VK_TAB))) then 3639 if Boolean(Hi(GetKeyState(VK_SHIFT))) then 3640 begin 3641 if lvNotes.CanFocus then 3642 lvNotes.SetFocus 3643 else if tvNotes.CanFocus then 3644 tvNotes.SetFocus; 3645 end 3646 else if frmDrawers.pnlTemplatesButton.CanFocus then 3647 frmDrawers.pnlTemplatesButton.SetFocus 3648 3649 end; 3650 3651 procedure TfrmNotes.lvNotesExit(Sender: TObject); 3652 begin 3653 inherited; 3654 if Boolean(Hi(GetKeyState(VK_TAB))) and Boolean(Hi(GetKeyState(VK_SHIFT))) then 3655 if tvNotes.CanFocus then 3656 tvNotes.SetFocus 3827 if memPCEShow.Visible then //CQ7120 3828 memPCEShow.SetFocus; //CQ7120 3829 end; 3830 3831 procedure TfrmNotes.ViewInfo(Sender: TObject); 3832 begin 3833 inherited; 3834 frmFrame.ViewInfo(Sender); 3835 end; 3836 3837 procedure TfrmNotes.mnuViewInformationClick(Sender: TObject); 3838 begin 3839 inherited; 3840 mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled; 3841 mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled; 3842 mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled; 3843 mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No'); 3844 mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No'); 3845 mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled; 3846 mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled; 3847 mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled; 3848 mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled; 3657 3849 end; 3658 3850 … … 3662 3854 3663 3855 finalization 3664 uPCEEdit.Free;3665 uPCEShow.Free;3856 if (uPCEEdit <> nil) then uPCEEdit.Free; //CQ7012 Added test for nil 3857 if (uPCEShow <> nil) then uPCEShow.Free; //CQ7012 Added test for nil 3666 3858 3667 3859 end.
Note:
See TracChangeset
for help on using the changeset viewer.