Changeset 1679 for cprs/trunk/CPRS-Chart/Consults/fConsults.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Consults/fConsults.pas
r829 r1679 180 180 imgLblImages: TVA508ImageListLabeler; 181 181 imgLblConsults: TVA508ImageListLabeler; 182 popNoteMemoViewCslt: TMenuItem; //wat cq 17586 182 183 procedure mnuChartTabClick(Sender: TObject); 183 184 procedure lstConsultsClick(Sender: TObject); … … 285 286 procedure cmdEditResubmitExit(Sender: TObject); 286 287 procedure cmdNewConsultExit(Sender: TObject); 288 procedure popNoteMemoViewCsltClick(Sender: TObject); //wat cq 17586 287 289 private 288 290 FocusToRightPanel : Boolean; … … 348 350 function UserIsSigner(NoteIEN: integer): boolean; 349 351 public 352 function CustomCanFocus(Control: TWinControl): Boolean; //CB 353 function LinesVisible(richedit: Trichedit): integer; //CB 350 354 function ActiveEditOf(AnIEN: Int64): Boolean; 351 355 function AllowContextChange(var WhyNot: string): Boolean; override; … … 364 368 property Drawers: TFrmDrawers read GetDrawers; // Keep Drawers published 365 369 end; 370 366 371 367 372 var … … 638 643 CurrNotifIEN := 0; 639 644 EditingIndex := -1; 640 tvConsults.Enabled := True; 641 lstConsults.Enabled := True ; 645 pnlConsultList.Enabled := True; //CQ#15785 646 // tvConsults.Enabled := True; 647 // lstConsults.Enabled := True ; 642 648 lstNotes.Enabled := True ; 643 649 pnlRead.BringToFront ; … … 769 775 try 770 776 ClearEditControls; 771 tvConsults.Enabled := False; 772 lstConsults.Enabled := False ; 777 pnlConsultList.Enabled := False; //CQ#15785 778 // tvConsults.Enabled := False; 779 // lstConsults.Enabled := False ; 773 780 FillChar(FEditNote, SizeOf(FEditNote), 0); //v15.7 774 781 with FEditNote do … … 899 906 begin 900 907 ClearEditControls; 901 lstConsults.Enabled := True; 902 tvConsults.Enabled := True; 908 pnlConsultList.Enabled := True; //CQ#15785 909 // lstConsults.Enabled := True; 910 // tvConsults.Enabled := True; 903 911 end; 904 912 SetResultMenus ; … … 930 938 AClassName := DCL_CONSULTS; 931 939 ClearEditControls; 932 lstConsults.Enabled := False ; 933 tvConsults.Enabled := False; 940 pnlConsultList.Enabled := False; //CQ#15785 941 // lstConsults.Enabled := False ; 942 // tvConsults.Enabled := False; 934 943 with FEditNote do 935 944 begin … … 1008 1017 InfoBox(CreatedNote.ErrorText, TX_CREATE_ERR, MB_OK); 1009 1018 HaveRequired := False; 1010 lstConsults.Enabled := True; 1011 tvConsults.Enabled := True; 1019 pnlConsultList.Enabled := True; //CQ#15785 1020 // lstConsults.Enabled := True; 1021 // tvConsults.Enabled := True; 1012 1022 end; {if CreatedNote.IEN} 1013 1023 end; {if HaveRequired} … … 1559 1569 end; 1560 1570 1571 //wat cq 17586 1572 procedure TfrmConsults.popNoteMemoViewCsltClick(Sender: TObject); 1573 var 1574 CsltIEN: integer ; 1575 ConsultDetail: TStringList; 1576 x: string; 1577 begin 1578 inherited; 1579 if (Screen.ActiveControl <> memResults) or (FEditNote.PkgPtr <> PKG_CONSULTS) then Exit; 1580 CsltIEN := frmConsults.FEditNote.PkgIEN; 1581 x := FindConsult(CsltIEN); 1582 ConsultDetail := TStringList.Create; 1583 try 1584 LoadConsultDetail(ConsultDetail, CsltIEN) ; 1585 ReportBox(ConsultDetail, 'Consult Details: #' + IntToStr(CsltIEN) + ' - ' + Piece(x, U, 4), TRUE); 1586 finally 1587 ConsultDetail.Free; 1588 end; 1589 end; //END cq 17586 1590 1561 1591 procedure TfrmConsults.mnuActAddIDEntryClick(Sender: TObject); 1562 1592 const … … 1792 1822 popNoteMemoEncounter.Visible := FALSE; 1793 1823 UpdateList; 1794 lstConsults.Enabled := True ; 1795 tvConsults.Enabled := True; 1824 pnlConsultList.Enabled := True; //CQ#15785 1825 // lstConsults.Enabled := True ; 1826 // tvConsults.Enabled := True; 1796 1827 with tvConsults do Selected := FindPieceNode(IntToStr(SaveConsult), 1, U, Items.GetFirstNode); 1797 1828 tvConsultsClick(Self); … … 1851 1882 pnlResults.Visible := False; 1852 1883 pnlResults.SendToBack; 1853 lstConsults.Enabled := True; 1854 tvConsults.Enabled := True; 1884 pnlConsultList.Enabled := True; //CQ#15785 1885 // lstConsults.Enabled := True; 1886 // tvConsults.Enabled := True; 1855 1887 if Notifications.Active then 1856 1888 with tvConsults do … … 1971 2003 pnlResults.Visible := False; 1972 2004 pnlResults.SendToBack; 1973 lstConsults.Enabled := True; 1974 tvConsults.Enabled := True; 2005 pnlConsultList.Enabled := True; //CQ#15785 2006 // lstConsults.Enabled := True; 2007 // tvConsults.Enabled := True; 1975 2008 if Notifications.Active then 1976 2009 with tvConsults do … … 2182 2215 ClearEditControls ; 2183 2216 lstNotes.Enabled := False ; 2184 lstConsults.Enabled := False ; 2185 tvConsults.Enabled := False; 2217 pnlConsultList.Enabled := False; //CQ#15785 2218 // lstConsults.Enabled := False ; 2219 // tvConsults.Enabled := False; 2186 2220 x := Piece(lstConsults.Items[lstConsults.ItemIndex], U, 12); 2187 2221 if x <> '' then … … 2223 2257 //UnlockConsultRequest(lstNotes.ItemIEN, lstConsults.ItemIEN); 2224 2258 lstNotes.Enabled := True ; 2225 lstConsults.Enabled := True ; 2226 tvConsults.Enabled := True; 2259 pnlConsultList.Enabled := True; //CQ#15785 2260 // lstConsults.Enabled := True ; 2261 // tvConsults.Enabled := True; 2227 2262 end; 2228 2263 … … 2396 2431 (MenuAccessRec.UserLevel = UL_UNRESTRICTED)) 2397 2432 and 2398 (ConsultRec.ORStatus=ST_COMPLETE) and2399 2433 ((lstNotes.ItemIndex > -1) and 2400 2434 ((ConsultRec.TIUResultNarrative>0) or … … 2625 2659 if ItemIndex = EditingIndex then 2626 2660 begin 2627 lstConsults.Enabled := False ; 2628 tvConsults.Enabled := False; 2661 pnlConsultList.Enabled := False; //CQ#15785 2662 // lstConsults.Enabled := False ; 2663 // tvConsults.Enabled := False; 2629 2664 pnlResults.Visible := True; 2630 2665 pnlResults.BringToFront; … … 2639 2674 if EditingIndex = -1 then 2640 2675 begin 2641 lstConsults.Enabled := True ; 2642 tvConsults.Enabled := True; 2676 pnlConsultList.Enabled := True; //CQ#15785 2677 // lstConsults.Enabled := True ; 2678 // tvConsults.Enabled := True; 2643 2679 end; 2644 2680 lblTitle.Caption := MakeConsultNoteDisplayText(lstNotes.Items[lstNotes.ItemIndex]); … … 2710 2746 popNoteMemoPreview.Enabled := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected); 2711 2747 popNoteMemoInsTemplate.Enabled := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected); 2748 popNoteMemoViewCslt.Enabled := (FEditNote.PkgPtr = PKG_CONSULTS); //wat cq 17586 2712 2749 end else 2713 2750 begin … … 2718 2755 popNoteMemoPreview.Enabled := False; 2719 2756 popNoteMemoInsTemplate.Enabled := False; 2757 popNoteMemoViewCslt.Enabled := FALSE; //wat cq 17586 2720 2758 end; 2721 2759 end; … … 2838 2876 end; 2839 2877 2840 {for printing multiple notes}2841 2878 procedure TfrmConsults.RequestMultiplePrint(AForm: TfrmPrintList); 2842 2879 var … … 2844 2881 i: integer; 2845 2882 begin 2883 inherited; 2846 2884 with AForm.lbIDParents do 2847 for i := 0 to Items.Count - 1 do 2848 if Selected[i] then 2849 begin 2850 NoteIEN := StrToInt64def(Piece(Items[i], U, 1), 0); 2851 if NoteIEN > 0 then PrintSF513(NoteIEN, DisplayText[i]) 2852 else if NoteIEN = 0 then InfoBox(TX_NOCONSULT, TX_NOCSLT_CAP, MB_OK) 2853 else InfoBox(TX_NOPRT_NEW, TX_NOPRT_NEW_CAP, MB_OK); 2854 end; 2885 begin 2886 for i := 0 to Items.Count - 1 do 2887 begin 2888 if Selected[i] then 2889 begin 2890 NoteIEN := ItemIEN; //StrToInt64def(Piece(TStringList(Items.Objects[i])[0],U,1),0); 2891 if NoteIEN > 0 then PrintSF513(NoteIEN, DisplayText[i]) else 2892 begin 2893 if NoteIEN = 0 then InfoBox(TX_NOCONSULT, TX_NOCSLT_CAP, MB_OK); 2894 if NoteIEN < 0 then InfoBox(TX_NOPRT_NEW, TX_NOPRT_NEW_CAP, MB_OK); 2895 end; 2896 end; {if selected} 2897 end; {for} 2898 end; {with} 2855 2899 end; 2856 2900 … … 3104 3148 AnObject: PDocTreeObject; 3105 3149 tmpNode: TORTreeNode; 3150 I:Integer; 3151 CommentDate: String; 3152 Format: CHARFORMAT2; 3153 VisibleLineCount: integer; 3106 3154 begin 3107 3155 if EditingIndex <> -1 then … … 3116 3164 tvConsults.Caption := Notifications.Text; 3117 3165 EditingIndex := -1; 3118 lstConsults.Enabled := True ; 3119 tvConsults.Enabled := True; 3166 pnlConsultList.Enabled := True; //CQ#15785 3167 // lstConsults.Enabled := True ; 3168 // tvConsults.Enabled := True; 3120 3169 lstNotes.Enabled := True ; 3121 3170 pnlRead.BringToFront ; … … 3204 3253 tvCsltNotesChange(Self, tvCsltNotes.Selected); 3205 3254 end 3206 else if (ConsultRec.ORStatus = ST_COMPLETE) and ((ConsultRec.TIUDocuments.Count + ConsultRec.MedResults.Count) > 0) then 3255 else if (ConsultRec.ORStatus = ST_COMPLETE) and ((ConsultRec.TIUDocuments.Count + ConsultRec.MedResults.Count) > 0) 3256 and (Pos(UpperCase('Comment added'), UpperCase(Notifications.Text)) = 0) then //CB 3207 3257 mnuActDisplayResultsClick(Self); 3208 3258 3259 //CB 3260 If (Notifications.HighLightSection <> '') and (Pos(UpperCase('Comment added'), UpperCase(Notifications.Text)) > 0) then begin 3261 CommentDate := FormatDateTime('mm/dd/yy hh:mm', StrToDateTime(StringReplace(Notifications.HighLightSection, '@', ' ', [rfReplaceAll])) ); 3262 for I := 0 to memConsult.Lines.Count - 1 do begin 3263 If (Pos(CommentDate, memConsult.Lines.Strings[i]) > 0) and (Pos(UpperCase('ADDED COMMENT'), UpperCase(memConsult.Lines.Strings[i])) > 0) then begin 3264 if CustomCanFocus(memconsult) then 3265 memConsult.SetFocus; 3266 memConsult.SelStart := memConsult.Perform(EM_LINEINDEX, i,0); 3267 memConsult.SelLength := Length(memConsult.Lines.Strings[i]); 3268 3269 //Set the background color 3270 Format.cbSize := SizeOf(Format); 3271 Format.dwMask := CFM_BACKCOLOR; 3272 3273 Format.crBackColor := clRed; 3274 memConsult.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(@Format)); 3275 //Get visible Line Couunt 3276 VisibleLineCount := LinesVisible(memConsult); 3277 3278 if (I + VisibleLineCount)>= memConsult.Lines.Count - 1 then 3279 memConsult.SelStart := memConsult.Perform(EM_LINEINDEX, memConsult.Lines.Count - 1,0) 3280 else memConsult.SelStart := memConsult.Perform(EM_LINEINDEX,I + VisibleLineCount - 1,0); 3281 3282 memConsult.Perform($00B7, 0, 0); //EM_SETCARRET DEFINED WRONG in Richedit.pas 3283 memConsult.SelLength := 0; 3284 break; 3285 end; 3286 end; 3287 end; 3288 3209 3289 case Notifications.Followup of 3210 3290 NF_CONSULT_REQUEST_RESOLUTION : Notifications.Delete; … … 3221 3301 FNotifPending := False; 3222 3302 end; 3303 3304 // ***************************************************************** 3305 // Delphi's Can Focus has a bug. 3306 // Source: http://qc.embarcadero.com/wc/qcmain.aspx?d=11229 3307 // ***************************************************************** 3308 function TfrmConsults.CustomCanFocus(Control: TWinControl): Boolean; 3309 var 3310 Form: TCustomForm; 3311 begin 3312 Result := False; 3313 Form := GetParentForm(Self); 3314 if Form <> nil then 3315 begin 3316 Control := Self; 3317 repeat 3318 if not (Control.Visible and Control.Enabled) then 3319 Exit; 3320 Control := Control.Parent; 3321 until Control = nil; 3322 Result := True; 3323 end; 3324 end; 3325 3326 function TfrmConsults.LinesVisible(richedit: Trichedit): integer; 3327 Var 3328 OldFont : HFont; 3329 Hand : THandle; 3330 TM : TTextMetric; 3331 Rect : TRect; 3332 tempint : integer; 3333 begin 3334 Hand := GetDC(richedit.Handle); 3335 try 3336 OldFont := SelectObject(Hand, richedit.Font.Handle); 3337 try 3338 GetTextMetrics(Hand, TM); 3339 richedit.Perform(EM_GETRECT, 0, longint(@Rect)); 3340 tempint := (Rect.Bottom - Rect.Top) div 3341 (TM.tmHeight + TM.tmExternalLeading); 3342 finally 3343 SelectObject(Hand, OldFont); 3344 end; 3345 finally 3346 ReleaseDC(richedit.Handle, Hand); 3347 end; 3348 Result := tempint; 3349 end; 3223 3350 3224 3351 procedure TfrmConsults.mnuActEditResubmitClick(Sender: TObject); … … 3948 4075 if not LockConsultRequest(AConsult) then Exit; 3949 4076 lstNotes.Enabled := False ; 3950 lstConsults.Enabled := False ; 3951 tvConsults.Enabled := False; 4077 pnlConsultList.Enabled := False; //CQ#15785 4078 // lstConsults.Enabled := False ; 4079 // tvConsults.Enabled := False; 3952 4080 if ActionType = 'ATTACH' then 3953 4081 begin … … 3980 4108 end; 3981 4109 lstNotes.Enabled := True ; 3982 lstConsults.Enabled := True ; 3983 tvConsults.Enabled := True; 4110 pnlConsultList.Enabled := True; //CQ#15785 4111 // lstConsults.Enabled := True ; 4112 // tvConsults.Enabled := True; 3984 4113 FOrderID := GetConsultOrderIEN(AConsult); 3985 4114 UnlockOrderIfAble(FOrderID); … … 4068 4197 cmdPCE.Visible := FALSE; 4069 4198 popNoteMemoEncounter.Visible := FALSE; 4070 lstConsults.Enabled := True ; 4071 tvConsults.Enabled := True; 4199 pnlConsultList.Enabled := True; //CQ#15785 4200 // lstConsults.Enabled := True ; 4201 // tvConsults.Enabled := True; 4072 4202 lstNotes.Enabled := True; 4073 4203 lblTitle.Caption := ''; … … 4435 4565 popNoteListExpandSelected.Enabled := Selected.HasChildren; 4436 4566 popNoteListCollapseSelected.Enabled := Selected.HasChildren; 4437 lstConsults.Enabled := True ; 4438 tvConsults.Enabled := True; 4567 pnlConsultList.Enabled := True; //CQ#15785 4568 // lstConsults.Enabled := True ; 4569 // tvConsults.Enabled := True; 4439 4570 lstNotes.Enabled := True; 4440 4571 if (Selected.ImageIndex in [IMG_GMRC_TOP_LEVEL, IMG_GMRC_GROUP_OPEN, IMG_GMRC_GROUP_SHUT]) then … … 4450 4581 cmdPCE.Visible := FALSE; 4451 4582 popNoteMemoEncounter.Visible := FALSE; 4452 lstConsults.Enabled := True ; 4453 tvConsults.Enabled := True; 4583 pnlConsultList.Enabled := True; //CQ#15785 4584 // lstConsults.Enabled := True ; 4585 // tvConsults.Enabled := True; 4454 4586 KillDocTreeObjects(tvCsltNotes); 4455 4587 tvCsltNotes.Items.Clear;
Note:
See TracChangeset
for help on using the changeset viewer.