Changeset 1679 for cprs/trunk/CPRS-Chart/fPtSel.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fPtSel.pas
r830 r1679 1 1 unit fPtSel; 2 2 { Allows patient selection using various pt lists. Allows display & processing of alerts. } 3 //vwpt enhancements included4 3 5 4 {$OPTIMIZATION OFF} // REMOVE AFTER UNIT IS DEBUGGED … … 38 37 lstvAlerts: TCaptionListView; 39 38 N1: TMenuItem; 40 RadioGroup1: TRadioGroup ;41 //RadioGroup1: TRadioGroup;42 39 cmdComments: TButton; 40 txtCmdComments: TVA508StaticText; 41 txtCmdRemove: TVA508StaticText; 42 txtCmdForward: TVA508StaticText; 43 txtCmdProcess: TVA508StaticText; 43 44 procedure cmdOKClick(Sender: TObject); 44 45 procedure cmdCancelClick(Sender: TObject); … … 80 81 procedure FormResize(Sender: TObject); 81 82 procedure cmdCommentsClick(Sender: TObject); 82 83 //VWPT ENAHANCED PATIENT LOOKUP 84 function IsOther(itemindex:Integer):Boolean; 85 86 procedure onclick1(Sender: TObject); 87 83 procedure lstvAlertsMouseUp(Sender: TObject; Button: TMouseButton; 84 Shift: TShiftState; X, Y: Integer); 85 procedure cboPatientKeyUp(Sender: TObject; var Key: Word; 86 Shift: TShiftState); 88 87 private 89 88 FsortCol: integer; … … 94 93 FNotificationBtnsAdjusted: Boolean; 95 94 FAlertsNotReady: boolean; 95 FMouseUpPos: TPoint; 96 96 procedure WMReadyAlert(var Message: TMessage); message UM_MISC; 97 97 procedure ReadyAlert; … … 107 107 procedure AdjustButtonSize(pButton:TButton); 108 108 procedure AdjustNotificationButtons; 109 procedure SetupDemographicsForm; 110 procedure ShowDisabledButtonTexts; 109 111 110 112 public … … 121 123 PtStrs: TStringList; 122 124 123 //vwpt enhancement124 itimson : integer = 1;125 enhanceskip : integer = 0;126 radiogrp1index : integer = 0;127 128 125 129 126 implementation … … 132 129 133 130 uses rCore, uCore, fDupPts, fPtSens, fPtSelDemog, fPtSelOptns, fPatientFlagMulti, 134 uOrPtf, fAlertForward, rMisc, fFrame, fRptBox, VA508AccessibilityRouter; 135 136 resourcestring 137 StrFPtSel_lstvAlerts_Co = 'C'+U+'fPtSel.lstvAlerts.Cols'; 131 uOrPtf, fAlertForward, rMisc, fFrame, fRptBox, VA508AccessibilityRouter, 132 VAUtils; 133 134 var 135 FDragging: Boolean = False; 138 136 139 137 const 140 138 AliasString = ' -- ALIAS'; 141 142 //VWPT ENAHANCED PATIENT LOOKUP143 function TfrmPtSel.IsOther(itemindex:Integer):Boolean;144 var145 i:Integer ;146 147 begin148 Result := True;149 if (RadioGroup1.ItemIndex = -1) or (RadioGroup1.ItemIndex = 0) or (itimson = 0) then Result := False;150 end;151 139 152 140 procedure SelectPatient(ShowNotif: Boolean; FontSize: Integer; var UserCancelled: boolean); … … 191 179 var 192 180 Rect: TRect; 193 // TheFormHeight: integer;194 181 SplitterTop, t1, t2, t3: integer; 195 182 begin 183 SetFormPosition(self); 196 184 ResizeAnchoredFormToFont(self); 197 // TheFormHeight := pnlPtSel.Height;198 // Make the form bigger (140%) to show notifications and show notification controls.199 185 if ShowNotif then 200 186 begin 201 // TheFormHeight := Round(TheFormHeight * 2.4);202 // pnlDivide.Height := lblNotifications.Height + 4;203 187 pnlDivide.Visible := True; 204 188 lstvAlerts.Visible := True; 205 189 pnlNotifications.Visible := True; 206 190 pnlPtSel.BevelOuter := bvRaised; 207 // ClientHeight := TheFormHeight;208 191 end 209 192 else … … 212 195 lstvAlerts.Visible := False; 213 196 pnlNotifications.Visible := False; 214 // ClientHeight := TheFormHeight; 215 // pnlPtSel.Anchors := [akLeft,akRight,akTop,akBottom]; 216 end; 217 // ClientHeight := TheFormHeight; 218 // VertScrollBar.Range := TheFormHeight; 219 220 //After all of this calcualtion, we still use the saved preferences when possible 221 SetFormPosition(self); 197 end; 198 //SetFormPosition(self); 222 199 Rect := BoundsRect; 223 200 ForceInsideWorkArea(Rect); 224 201 BoundsRect := Rect; 225 226 202 if frmFrame.EnduringPtSelSplitterPos <> 0 then 227 203 SplitterTop := frmFrame.EnduringPtSelSplitterPos … … 270 246 Items.Add(LLS_SPACE); 271 247 cboPatient.InitLongList(''); 272 //VWPT273 //cboPatient.LongList := True;274 //cboPateint.HintonItem := True;275 //end276 248 RedrawActivate(cboPatient.Handle); 277 249 end; … … 402 374 end; 403 375 404 var caption:string;405 index:integer;406 407 408 376 begin 409 377 with cboPatient do 410 if IsOther(integer(1))and (IsRPL <> '1')and (enhanceskip=0) and (frmPtSelOptns.IsEnhanced(Text))and (not frmPtSelOptns.IsPatientName(Text)) then 411 begin 412 if (IsRPL = '1') then 413 ///ListPtByRPLLast5(Items, Text) Messagebox error 414 else 415 begin 416 index := RadioGroup1.ItemIndex; 417 caption := piece(RadioGroup1.Items[index],'&',2); 418 //Application.MessageBox(pChar(caption), pChar('Message'),MB_OK); 419 //caption := '' ; //derivative of integer(1) or other index of radio button selection 420 ListPtByOther(Items, Text,caption); // one extra argument on radio button selection 421 if Items.Count>0 then 422 begin 423 //itimson :=0 ;//no check for timson change in cbopatient until after click event finished 424 RadioGroup1.ItemIndex := 0; 425 RadioGroup1.SetFocus; 426 RadioGroup1.Refresh; 427 end; 428 ShowMatchingPatients; 429 end; 430 end 431 else if frmPtSelOptns.IsLast5(Text) then 378 if frmPtSelOptns.IsLast5(Text) then 432 379 begin 433 380 if (IsRPL = '1') then … … 443 390 else 444 391 ListPtByFullSSN(Items, Text); 445 ShowMatchingPatients 446 end 447 else if (not IsOther(integer(1))) and (IsRPL <> '1')and (enhanceskip=0) and (frmPtSelOptns.IsEnhanced(Text)) and (not frmPtSelOptns.IsPatientName(Text)) then 448 begin 449 450 ListPtByTimson(Items,Text) ; 451 ShowMatchingPatients; 452 //vwpt enhanced changes 453 //check for change here if itimson flag =1 .no matter what however, even if 0, 454 //set it back to 1 455 //itimson :=1; 456 //end vwpt enhanced 457 458 459 end 460 //enhanceskip := 0 ; 392 ShowMatchingPatients; 393 end; 461 394 end; 462 395 … … 473 406 end; 474 407 408 procedure TfrmPtSel.cboPatientKeyUp(Sender: TObject; var Key: Word; 409 Shift: TShiftState); 410 begin 411 inherited; 412 if (Key = VK_BACK) and (cboPatient.Text = '') then cboPatient.ItemIndex := -1; 413 end; 414 475 415 procedure TfrmPtSel.cboPatientMouseClick(Sender: TObject); 476 416 begin … … 487 427 procedure TfrmPtSel.cboPatientDblClick(Sender: TObject); 488 428 begin 489 // vwpt enhanced on click or double clck set mode back to normal to a.) not allow change event490 //erroneously checked with false lookup, and b.0 immedicately put back into normal mode491 //without separate step needed.492 if (RadioGroup1.ItemIndex > 0) then493 begin494 //itimson :=0 ;//no check for timson change in cbopatient until after click event finished495 RadioGroup1.ItemIndex := 0;496 RadioGroup1.SetFocus;497 RadioGroup1.Refresh;498 end;499 //enhanceskip:=1 ;500 501 //end vwpt enhanced502 429 if Length(cboPatient.ItemID) > 0 then cmdOKClick(Self); //*DFN* 503 430 end; … … 573 500 AccessStatus: integer; 574 501 begin 575 // vwpt enhanced on click or double clck set mode back to normal to a.) not allow change event576 //erroneiusly checked with false lookup, and b.0 immedicately put back into normal mode577 //without separate step needed.578 if (RadioGroup1.ItemIndex > 0 ) then579 begin580 //itimson :=0 ;//no check for timson change in cbopatient until after click event finished581 RadioGroup1.ItemIndex := 0;582 RadioGroup1.SetFocus;583 RadioGroup1.Refresh;584 end;585 586 //end vwpt enhanced587 502 if not (Length(cboPatient.ItemID) > 0) then //*DFN* 588 503 begin … … 731 646 ADFN := Piece(XQAID, ',', 2); //*DFN* 732 647 AFollowUp := StrToIntDef(Piece(Piece(XQAID, ';', 1), ',', 3), 0); 733 Notifications.Add(ADFN, AFollowUp, RecordID );648 Notifications.Add(ADFN, AFollowUp, RecordID, Items[i].SubItems[3]); //CB 734 649 enableclose := true; 735 650 end … … 812 727 813 728 procedure TfrmPtSel.lstvAlertsDblClick(Sender: TObject); 729 var 730 ScreenCurPos, ClientCurPos: TPoint; 814 731 begin 815 732 cmdProcessClick(Self); 733 ScreenCurPos.X := 0; 734 ScreenCurPos.Y := 0; 735 ClientCurPos.X := 0; 736 ClientCurPos.Y := 0; 737 if GetCursorPos(ScreenCurPos) then ClientCurPos := lstvAlerts.ScreenToClient(ScreenCurPos); //convert screen coord. to client coord. 738 //fixes CQ 18657: double clicking on notification, does not go to pt. chart until mouse is moved. [v28.4 - TC] 739 if (FMouseUpPos.X = ClientCurPos.X) and (FMouseUpPos.Y = ClientCurPos.Y) then 740 begin 741 lstvAlerts.BeginDrag(False,0); 742 FDragging := True; 743 end; 816 744 end; 817 745 … … 866 794 867 795 procedure TfrmPtSel.FormDestroy(Sender: TObject); 796 var 797 i: integer; 798 AString: string; 868 799 begin 869 800 SaveUserBounds(Self); 870 801 frmFrame.EnduringPtSelSplitterPos := pnlPtSel.Height; 802 AString := ''; 803 for i := 0 to 6 do 804 begin 805 AString := AString + IntToStr(lstvAlerts.Column[i].Width); 806 if i < 6 then AString:= AString + ','; 807 end; 808 frmFrame.EnduringPtSelColumns := AString; 871 809 end; 872 810 … … 888 826 begin 889 827 frmPtSelDemog.Left := cboPatient.Left + cboPatient.Width + 9; 890 // frmPtSelDemog.Width := frmPtSel.CmdCancel.Left - frmPtSelDemog.Left-2;// before vwpt enhancementspnlPtSel.Width - frmPtSelDemog.Left - 2;828 frmPtSelDemog.Width := pnlPtSel.Width - frmPtSelDemog.Left - 2; 891 829 frmPtSelOptns.Width := cboPatient.Left-8; 892 830 end; … … 895 833 begin 896 834 inherited; 897 // This needs to be in Loaded rather than FormCreate or the TORAutoPanel resize logic breaks. 898 //vwpt enhancements 899 CmdOK.parent := pnlPtSel; 900 CmdCancel.parent := pnlPtSel; 901 //end vwpt 902 frmPtSelDemog := TfrmPtSelDemog.Create(Self); // Was application - kcm 903 with frmPtSelDemog do 904 begin 905 parent := pnlPtSel; 906 Top := 4; //before vwpt change was 65 907 Left := cboPatient.Left + cboPatient.Width + 9; 908 //Width := pnlPtSel.Width - Left - 2; //before vwpt change 909 Width := CmdCancel.Left - Left-2 ; 910 TabOrder := cmdCancel.TabOrder + 1; //Place after cancel button 911 Show; 912 end; 913 914 with RadioGroup1 do 915 begin 916 parent := pnlPtSel; 917 TabOrder := cmdCancel.TabOrder + 2; 918 Show; 919 end; 920 //end vwpt enhancements 835 SetupDemographicsForm; 921 836 922 837 frmPtSelOptns := TfrmPtSelOptns.Create(Self); // Was application - kcm … … 940 855 end; 941 856 857 procedure TfrmPtSel.ShowDisabledButtonTexts; 858 begin 859 if ScreenReaderActive then 860 begin 861 txtCmdProcess.Visible := not cmdProcess.Enabled; 862 txtCmdRemove.Visible := not cmdRemove.Enabled; 863 txtCmdForward.Visible := not cmdForward.Enabled; 864 txtCmdComments.Visible := not cmdComments.Enabled; 865 end; 866 end; 867 868 procedure TfrmPtSel.SetupDemographicsForm; 869 begin 870 // This needs to be in Loaded rather than FormCreate or the TORAutoPanel resize logic breaks. 871 frmPtSelDemog := TfrmPtSelDemog.Create(Self); 872 // Was application - kcm 873 with frmPtSelDemog do 874 begin 875 parent := pnlPtSel; 876 Top := cmdCancel.Top + cmdCancel.Height + 2; 877 Left := cboPatient.Left + cboPatient.Width + 9; 878 Width := pnlPtSel.Width - Left - 2; 879 TabOrder := cmdCancel.TabOrder + 1; 880 //Place after cancel button 881 Show; 882 end; 883 if ScreenReaderActive then begin 884 frmPtSelDemog.Memo.Show; 885 frmPtSelDemog.Memo.BringToFront; 886 end; 887 end; 888 942 889 procedure TfrmPtSel.RPLDisplay; 943 890 begin … … 950 897 951 898 procedure TfrmPtSel.FormClose(Sender: TObject; var Action: TCloseAction); 952 var 953 colSizes : String; 954 begin 955 colSizes := ''; 956 with lstvAlerts do begin 957 colSizes := IntToStr(Columns[0].Width) + ','; //Info Caption 958 colSizes := colSizes + IntToStr(Columns[1].Width) + ','; //Patient SubItems[0] 959 colSizes := colSizes + IntToStr(Columns[2].Width) + ','; //Location SubItems[1] 960 colSizes := colSizes + IntToStr(Columns[3].Width) + ','; //Urgency SubItems[2] 961 colSizes := colSizes + IntToStr(Columns[4].Width) + ','; //Alert Date/Time SubItems[3] 962 colSizes := colSizes + IntToStr(Columns[5].Width) + ','; //Message Text SubItems[4] 963 colSizes := colSizes + IntToStr(Columns[6].Width); //Forwarded By/When SubItems[5] 964 end; 965 SizeHolder.SetSize(StrFPtSel_lstvAlerts_Co,colSizes); 899 begin 900 if FDragging then 901 begin 902 lstvAlerts.EndDrag(True); //terminate fake dragging operation from lstvAlertsDblClick. 903 FDragging := False; 904 end; 966 905 967 906 if (IsRPL = '1') then // Deal with restricted patient list users. … … 975 914 DefaultButton := cmdOK; 976 915 FAlertsNotReady := FALSE; 916 ShowDisabledButtonTexts; 977 917 end; 978 918 … … 1060 1000 NewItem: TListItem; 1061 1001 I,J: Integer; 1062 Comment ,colSizes: String;1002 Comment: String; 1063 1003 begin 1064 1004 // Load the items 1065 colSizes := '';1066 1005 lstvAlerts.Items.Clear; 1067 1006 List := TStringList.Create; … … 1092 1031 with lstvAlerts do 1093 1032 begin 1094 colSizes := SizeHolder.GetSize(StrFPtSel_lstvAlerts_Co); 1095 if colSizes = '' then begin 1096 Columns[0].Width := 40; //Info Caption 1097 Columns[1].Width := 195; //Patient SubItems[0] 1098 Columns[2].Width := 75; //Location SubItems[1] 1099 Columns[3].Width := 95; //Urgency SubItems[2] 1100 Columns[4].Width := 150; //Alert Date/Time SubItems[3] 1101 Columns[5].Width := 310; //Message Text SubItems[4] 1102 Columns[6].Width := 290; //Forwarded By/When SubItems[5] 1103 end else begin 1104 Columns[0].Width := StrToInt(piece(colSizes,',',1)); //Info Caption 1105 Columns[1].Width := StrToInt(piece(colSizes,',',2)); //Patient SubItems[0] 1106 Columns[2].Width := StrToInt(piece(colSizes,',',3)); //Location SubItems[1] 1107 Columns[3].Width := StrToInt(piece(colSizes,',',4)); //Urgency SubItems[2] 1108 Columns[4].Width := StrToInt(piece(colSizes,',',5)); //Alert Date/Time SubItems[3] 1109 Columns[5].Width := StrToInt(piece(colSizes,',',6)); //Message Text SubItems[4] 1110 Columns[6].Width := StrToInt(piece(colSizes,',',7)); //Forwarded By/When SubItems[5] 1111 end; 1112 1033 Columns[0].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 1), 40); //Info Caption 1034 Columns[1].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 2), 195); //Patient SubItems[0] 1035 Columns[2].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 3), 75); //Location SubItems[1] 1036 Columns[3].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 4), 95); //Urgency SubItems[2] 1037 Columns[4].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 5), 150); //Alert Date/Time SubItems[3] 1038 Columns[5].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 6), 310); //Message Text SubItems[4] 1039 Columns[6].Width := StrToIntDef(Piece(frmFrame.EnduringPtSelColumns, ',', 7), 290); //Forwarded By/When SubItems[5] 1113 1040 //Items not displayed in Columns: XQAID SubItems[6] 1114 1041 // Remove w/o process SubItems[7] 1115 1042 // Forwarding comments SubItems[8] 1116 1043 end; 1117 //with lstvAlerts do ca comment out 12/24/03 to prevent default selection of first alert on list1118 //if (ItemIndex = -1) and (Items.Count > 0) then1119 //ItemIndex := 0;1120 1044 end; 1121 1045 … … 1254 1178 cmdForward.Enabled := ShowButts; 1255 1179 cmdComments.Enabled := ShowButts and (lstvAlerts.SelCount = 1) and (lstvAlerts.Selected.SubItems[8] <> ''); 1180 ShowDisabledButtonTexts; 1256 1181 end; 1257 1182 … … 1285 1210 end; 1286 1211 1212 procedure TfrmPtSel.lstvAlertsMouseUp(Sender: TObject; Button: TMouseButton; 1213 Shift: TShiftState; X, Y: Integer); 1214 begin 1215 inherited; 1216 FMouseUpPos := Point(X,Y); 1217 end; 1218 1287 1219 procedure TfrmPtSel.FormShow(Sender: TObject); 1288 1220 { … … 1296 1228 sortResult := rCore.GetSortMethod; 1297 1229 sortMethod := Piece(sortResult, U, 1); 1230 if sortMethod = '' then 1231 sortMethod := 'D'; 1298 1232 FsortDirection := Piece(sortResult, U, 2); 1299 1233 if FsortDirection = 'F' then … … 1385 1319 end; 1386 1320 1387 //vwpt enhanced //1388 procedure TfrmPtSel.onclick1(Sender: TObject); //click on RadioGroup11389 var index :integer;1390 1391 begin1392 if RadioGroup1.ItemIndex >0 then1393 begin1394 itimson := 1 ;1395 cboPatient.Text := '' ;1396 if (frmPtSelOptns.radAll.Checked <> True)and (frmPtSelOptns.radDflt.Checked <> True) then1397 begin1398 radiogrp1index :=0 ;1399 RadioGroup1.ItemIndex := 0;1400 RadioGroup1.SetFocus;1401 RadioGroup1.Refresh;1402 end1403 else1404 begin1405 index := RadioGroup1.ItemIndex;1406 radiogrp1index := index;1407 cboPatient.Hint := 'Enter ' + piece(RadioGroup1.Items[index],'&',2);1408 end ;1409 end1410 else1411 begin1412 //itimson := 0;1413 cboPatient.Hint := 'Enter name,Full SSN,Last4(x1234),''HRN'',DOB,or Phone#' ;1414 radiogrp1index := 0;1415 end;1416 1417 end;1418 //end vwpt enhanced1419 1420 1321 1421 1322 end.
Note:
See TracChangeset
for help on using the changeset viewer.