Changeset 1679 for cprs/trunk/CPRS-Chart/fMeds.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fMeds.pas
r830 r1679 1 unit fMeds;1 unit fMeds; 2 2 3 3 {$OPTIMIZATION OFF} // REMOVE AFTER UNIT IS DEBUGGED … … 89 89 pnlView: TPanel; 90 90 txtView: TVA508StaticText; 91 mnuActUnhold: TMenuItem; 91 92 procedure mnuChartTabClick(Sender: TObject); 92 93 procedure FormCreate(Sender: TObject); … … 157 158 procedure SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click( 158 159 Sender: TObject); 160 procedure mnuActUnholdClick(Sender: TObject); 159 161 private 160 162 FIterating: Boolean; … … 238 240 implementation 239 241 240 uses uCore, rCore, fFrame, fRptBox, uOrders, fODBase, fOrdersDC, fOrdersHold, 242 uses uCore, rCore, fFrame, fRptBox, uOrders, fODBase, fOrdersDC, fOrdersHold, fOrdersUnhold, 241 243 fOrdersRenew, fOMNavA, fOrdersRefill, fMedCopy, fOrders, fODChild, rODBase, 242 244 StrUtils, fActivateDeactivate, VA2006Utils, VA508AccessibilityRouter, … … 268 270 TC_NO_RENEW = 'Unable to Renew Order'; 269 271 TX_NO_HOLD = CRLF + CRLF + '- cannot be placed on hold.' + CRLF + CRLF + 'Reason: '; 270 TC_NO_HOLD = 'Unable to Hold'; 272 TC_NO_HOLD = 'Unable to Hold'; 273 TX_NO_UNHOLD = CRLF + CRLF + '- cannot be released from hold.' + CRLF + CRLF + 'Reason: '; 274 TC_NO_UNHOLD = 'Unable to Release from Hold'; 271 275 TX_NO_COPY = CRLF + CRLF + '- cannot be copied.' + CRLF + CRLF + 'Reason: '; 272 276 TC_NO_COPY = 'Unable to Copy Order'; … … 729 733 procedure TfrmMeds.RefreshMedLists; 730 734 var 731 i, view: Integer;735 i, view: Integer; 732 736 AMed: TMedListRec; 733 begin 737 DateRange: string; 738 begin 739 if frmFrame.TimedOut then Exit; 734 740 lstMedsIn.Clear; 735 741 lstMedsOut.Clear; 736 742 lstMedsNonVA.Clear; 743 DateRange := ''; 737 744 StatusText('Retrieving active medications...'); 738 745 view := self.FSortView; 739 746 //AGP Fix for CQ 10410 added view arguement to control Meds Tab sort criteria 740 LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA, view); 741 if view <> self.FSortView then 742 begin 747 LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA, view, DateRange); 743 748 self.FSortView := view; 744 749 if view = 1 then 745 750 begin 746 751 self.SortbyStatusthenLocation1.Checked := True; 747 SetViewCaption(SortbyStatusthenLocation1.Caption );752 SetViewCaption(SortbyStatusthenLocation1.Caption + ' ' + DateRange); 748 753 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False; 749 754 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.checked := false; … … 753 758 self.SortbyStatusthenLocation1.Checked := False; 754 759 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True; 755 SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption );760 SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption + ' ' + DateRange); 756 761 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false; 757 762 end … … 761 766 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false; 762 767 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true; 763 SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption); 764 end 765 end; 768 SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption + ' ' + DateRange); 769 end; 766 770 uPharmacyOrdersIn.Clear; 767 771 uPharmacyOrdersOut.Clear; … … 808 812 else if Abbreviation = 'DL' then result := 'Deleted' 809 813 else if Abbreviation = 'DC' then result := 'DC' 814 else if Abbreviation = 'UH' then result := 'Unhold' 815 810 816 else result := Abbreviation; 811 817 end; … … 1147 1153 if ExecuteDCOrders(SelectedList,DelEvt) then 1148 1154 begin 1149 if frmFrame.TimedOut = true then exit;1150 1155 ResetSelectedForList(ActiveList); 1151 1156 SynchListToOrders(ActiveList, SelectedList); … … 1181 1186 if ExecuteHoldOrders(SelectedList) then 1182 1187 begin 1183 if frmFrame.TimedOut = true then exit;1184 1188 AddSelectedToChanges(SelectedList); 1185 1189 ResetSelectedForList(ActiveList); … … 1188 1192 end; 1189 1193 finally 1190 if frmFrame.TimedOut = false thenActiveList.SetFocus;1194 ActiveList.SetFocus; 1191 1195 FIterating := False; 1192 1196 SelectedList.Free; … … 1226 1230 if ExecuteRenewOrders(SelectedList) then 1227 1231 begin 1228 if frmFrame.TimedOut = true then exit;1229 1232 AddSelectedToChanges(SelectedList); 1230 1233 ResetSelectedForList(ActiveList); … … 1233 1236 end; 1234 1237 finally 1235 if frmFrame.TimedOut = false then ActiveList.SetFocus; 1238 ActiveList.SetFocus; 1239 FIterating := False; 1240 SelectedList.Free; 1241 UnlockIfAble; 1242 end; 1243 end; 1244 1245 procedure TfrmMeds.mnuActUnholdClick(Sender: TObject); 1246 var 1247 ActiveList: TListBox; 1248 SelectedList: TList; 1249 begin 1250 inherited; 1251 ActiveList := ListSelected(TX_NOSEL); 1252 if ActiveList = nil then Exit; 1253 if not AuthorizedUser then Exit; 1254 if not EncounterPresent then Exit; 1255 if not LockedForOrdering then Exit; 1256 SelectedList := TList.Create; 1257 try 1258 if CheckMedStatus(ActiveList) = True then Exit; 1259 ValidateSelected(ActiveList, OA_UNHOLD, TX_NO_UNHOLD, TC_NO_UNHOLD); // validate release hold action 1260 MakeSelectedList(ActiveList, SelectedList); // build list of selected orders 1261 if ExecuteUnholdOrders(SelectedList) then 1262 begin 1263 AddSelectedToChanges(SelectedList); 1264 ResetSelectedForList(ActiveList); 1265 SynchListToOrders(ActiveList, SelectedList); 1266 end; 1267 finally 1268 ActiveList.SetFocus; 1236 1269 FIterating := False; 1237 1270 SelectedList.Free; … … 1268 1301 if not ShowMsgOn(ChangeIFNList.Count = 0, TX_NOSEL, TC_NOSEL) 1269 1302 then ChangeOrders(ChangeIFNList, DelayEvent); 1270 if frmFrame.TimedOut = true then exit;1271 1303 SynchListToOrders(ActiveList, SelectedList); // rehighlights 1272 1304 Activelist.SetFocus; … … 1282 1314 const 1283 1315 CP_TXT = 'copied'; 1284 XF_TXT = 'transfer ed';1316 XF_TXT = 'transferred'; 1285 1317 var 1286 1318 i: Integer; … … 1420 1452 end; 1421 1453 end; 1422 if frmFrame.TimedOut = true then exit;1423 1454 SynchListToOrders(ActiveList, SelectedList); // rehighlights 1424 1455 if IsTransferAction then … … 1430 1461 frmOrders.PtEvtCompleted(TempEvent.PtEventIFN,TempEvent.EventName,True); 1431 1462 finally 1432 if frmFrame.TimedOut = false thenActiveList.SetFocus;1463 ActiveList.SetFocus; 1433 1464 FActionOnMedsTab := False; 1434 1465 uAutoAC := False; … … 1489 1520 if ExecuteRefillOrders(SelectedList) then 1490 1521 begin 1491 if frmFrame.TimedOut = true then exit;1492 1522 ResetSelectedForList(ActiveList); 1493 1523 SynchListToOrders(ActiveList, SelectedList); … … 1495 1525 end; 1496 1526 finally 1497 if frmFrame.TimedOut = false thenActiveList.SetFocus;1527 ActiveList.SetFocus; 1498 1528 FIterating := False; 1499 1529 SelectedList.Free; … … 1590 1620 if (AnOrder.DGroup = ClinDisp) then //imo 1591 1621 begin 1592 x := AnOrder.Text + #13#10 + 'Clinic medication orders can not be transfer ed';1622 x := AnOrder.Text + #13#10 + 'Clinic medication orders can not be transferred'; 1593 1623 if ShowMsgOn(Length(x) > 0, x, 'Unable to transfer.') then 1594 1624 begin … … 2150 2180 inherited; 2151 2181 self.FSortView := 1; 2152 self.SortbyStatusthenLocation1.Checked := True;2153 SetViewCaption(SortbyStatusthenLocation1.Caption);2154 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False;2155 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;2156 2182 self.RefreshMedLists; 2157 2183 end; … … 2162 2188 inherited; 2163 2189 self.FSortView := 2; 2164 self.SortbyStatusthenLocation1.Checked := False;2165 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True;2166 SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption);2167 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;2168 2190 self.RefreshMedLists; 2169 2191 end; … … 2174 2196 inherited; 2175 2197 self.FSortView := 3; 2176 self.SortbyStatusthenLocation1.Checked := False;2177 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false;2178 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true;2179 SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption);2180 2198 self.RefreshMedLists; 2181 2199 end;
Note:
See TracChangeset
for help on using the changeset viewer.