Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/fPtSel.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/fPtSel.pas
r459 r460 3 3 4 4 {$OPTIMIZATION OFF} // REMOVE AFTER UNIT IS DEBUGGED 5 6 {$define VAA} 5 7 6 8 interface … … 77 79 FsortAscending: boolean; 78 80 FLastPt: string; 81 FsortDirection: string; 82 FUserCancelled: boolean; 79 83 procedure AdjustFormSize(ShowNotif: Boolean; FontSize: Integer); 80 84 procedure ClearIDInfo; … … 85 89 procedure RPLDisplay; 86 90 procedure AlertList; 91 procedure ReformatAlertDateTime; 87 92 public 88 93 procedure Loaded; override; 89 94 end; 90 95 91 procedure SelectPatient(ShowNotif: Boolean; FontSize: Integer );96 procedure SelectPatient(ShowNotif: Boolean; FontSize: Integer; var UserCancelled: boolean); 92 97 93 98 var … … 114 119 AliasString = ' -- ALIAS'; 115 120 116 procedure SelectPatient(ShowNotif: Boolean; FontSize: Integer );121 procedure SelectPatient(ShowNotif: Boolean; FontSize: Integer; var UserCancelled: boolean); 117 122 { displays patient selection dialog (with optional notifications), updates Patient object } 118 123 var … … 137 142 end; 138 143 Notifications.Clear; 144 FsortCol := -1; 139 145 AlertList; 140 146 ClearIDInfo; 141 147 if (IsRPL = '1') then // Deal with restricted patient list users. 142 148 RPLDisplay; // Removes unnecessary components from view. 149 FUserCancelled := FALSE; 143 150 ShowModal; 151 UserCancelled := FUserCancelled; 144 152 end; 145 153 finally … … 539 547 if User.IsProvider then Encounter.Provider := User.DUZ; 540 548 541 GetBAStatus(Encounter.Provider, Encounter.Location);549 GetBAStatus(Encounter.Provider,Patient.DFN); 542 550 //HDS00005025 543 if BILLING_AWARE then 544 if Assigned(UBAGLOBALS.BAOrderList) then UBAGLOBALS.BAOrderList.Clear; 551 if BILLING_AWARE then 552 if Assigned(UBAGLOBALS.BAOrderList) then UBAGLOBALS.BAOrderList.Clear; 553 FUserCancelled := FALSE; 545 554 Close; 546 555 end; … … 549 558 begin 550 559 // Leave Patient object unchanged 560 FUserCancelled := TRUE; 551 561 Close; 552 562 end; … … 633 643 lstvAlerts.Clear; 634 644 AlertList; 645 //display alerts sorted according to parameter settings: 646 FsortCol := -1; //CA - display alerts in correct sort 647 FormShow(Sender); 635 648 end; 636 649 if Items.Count = 0 then ShowButts(False); 637 650 if SelCount <= 0 then ShowButts(False); 638 651 end; 639 GetBAStatus(User.DUZ, Encounter.Location);652 GetBAStatus(User.DUZ,Patient.DFN); 640 653 end; 641 654 … … 723 736 lstvAlerts.Clear; 724 737 AlertList; 725 FsortCol := 0; //CA - display alerts in correct sort738 FsortCol := -1; //CA - display alerts in correct sort 726 739 FormShow(Sender); //CA - display alerts in correct sort 727 740 if lstvAlerts.Items.Count = 0 then ShowButts(False); … … 805 818 function ConvertDate(var thisList: TStringList; listIndex: integer) : string; 806 819 { 807 C Q1075: Convert date portion from yyyy/mm/dd to mm/dd/yyyy820 Convert date portion from yyyy/mm/dd to mm/dd/yyyy 808 821 } 809 822 var … … 887 900 for I := 0 to List.Count - 1 do 888 901 begin 889 //CQ1075: Convert date portion from yyyy/mm/dd to mm/dd/yyyy 890 List[i] := ConvertDate(List, i); 902 // List[i] := ConvertDate(List, i); //cla commented out 8/9/04 CQ #4749 891 903 892 904 if Piece(List[I], U, 1) <> 'Forwarded by: ' then … … 929 941 930 942 if ((FsortCol = Column.Index) and (not SortViaKeyboard)) then 931 FsortAscending := not FsortAscending 943 FsortAscending := not FsortAscending; 944 945 if FsortAscending then 946 FsortDirection := 'F' 932 947 else 933 if Column.Index = 4 then 934 FsortAscending := false 935 else 936 FsortAscending := true; 948 FsortDirection := 'R'; 937 949 938 950 FsortCol := Column.Index; 939 lstvAlerts.AlphaSort; 951 952 if FsortCol = 4 then 953 ReformatAlertDateTime // hds7397- ge 2/6/6 sort and display date/time column correctly - as requested 954 else 955 lstvAlerts.AlphaSort; 940 956 SortViaKeyboard := false; 957 941 958 942 959 //Set the Notifications sort method to last-used sort-type 943 960 //ie., user clicked on which column header last use of CPRS? 944 961 case Column.Index of 945 0: rCore.SetSortMethod('I' );946 1: rCore.SetSortMethod('P' );947 2: rCore.SetSortMethod('L' );948 3: rCore.SetSortMethod('U' );949 4: rCore.SetSortMethod('D' );950 5: rCore.SetSortMethod('M' );951 6: rCore.SetSortMethod('F' );962 0: rCore.SetSortMethod('I', FsortDirection); 963 1: rCore.SetSortMethod('P', FsortDirection); 964 2: rCore.SetSortMethod('L', FsortDirection); 965 3: rCore.SetSortMethod('U', FsortDirection); 966 4: rCore.SetSortMethod('D', FsortDirection); 967 5: rCore.SetSortMethod('M', FsortDirection); 968 6: rCore.SetSortMethod('F', FsortDirection); 952 969 end; 953 970 end; … … 1022 1039 // pnlPrf.Visible := True; 1023 1040 end 1024 //else pnlPrf.Visible := False;1041 //else pnlPrf.Visible := False; 1025 1042 end; 1026 1043 … … 1043 1060 if lstvAlerts.SelCount <= 0 then ShowButts(False) 1044 1061 else ShowButts(True); 1045 GetBAStatus(User.DUZ, Encounter.Location);1062 GetBAStatus(User.DUZ,Patient.DFN); 1046 1063 end; 1047 1064 … … 1100 1117 } 1101 1118 var 1119 sortResult: string; 1102 1120 sortMethod: string; 1103 1121 begin 1104 sortMethod := rCore.GetSortMethod; 1122 sortResult := rCore.GetSortMethod; 1123 sortMethod := Piece(sortResult, U, 1); 1124 FsortDirection := Piece(sortResult, U, 2); 1125 if FsortDirection = 'F' then 1126 FsortAscending := true 1127 else 1128 FsortAscending := false; 1105 1129 1106 1130 case sortMethod[1] of … … 1115 1139 end; 1116 1140 1141 //hds7397- ge 2/6/6 sort and display date/time column correctly - as requested 1142 procedure TfrmPtSel.ReformatAlertDateTime; 1143 var 1144 I,J: Integer; 1145 inDateStr, holdDayTime,srtDate: String; 1146 begin 1147 // convert date to yyyy/mm/dd prior to sort. 1148 for J := 0 to lstvAlerts.items.count -1 do 1149 begin 1150 inDateStr := ''; 1151 srtDate := ''; 1152 holdDayTime := ''; 1153 inDateStr := lstvAlerts.Items[j].SubItems[3]; 1154 srtDate := ( (Piece( Piece(inDateStr,'/',3), '@',1)) + '/' + Piece(inDateStr,'/',1) + '/' + Piece(inDateStr,'/',2) +'@'+ Piece(inDateStr, '@',2) ); 1155 lstvAlerts.Items[j].SubItems[3] := srtDate; 1156 end; 1157 //sort the listview records by date 1158 lstvAlerts.AlphaSort; 1159 // loop thru lstvAlerts change date to yyyy/mm/dd 1160 // sort list 1161 // change alert date/time back to mm/dd/yyyy@time for display 1162 for I := 0 to lstvAlerts.items.Count -1 do 1163 begin 1164 inDateStr := ''; 1165 srtDate := ''; 1166 holdDayTime := ''; 1167 inDateStr := lstvAlerts.Items[i].SubItems[3]; 1168 holdDayTime := Piece(inDateStr,'/',3); // dd@time 1169 lstvAlerts.Items[i].SubItems[3] := (Piece(inDateStr, '/', 2) + '/' + Piece(holdDayTime, '@',1) +'/' 1170 + Piece(inDateStr,'/',1) + '@' + Piece(holdDayTime,'@',2) ); 1171 end; 1172 end; 1173 1117 1174 Initialization 1118 1175 SortViaKeyboard := false;
Note:
See TracChangeset
for help on using the changeset viewer.