Changeset 830 for cprs/trunk/CPRS-Chart/fMeds.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fMeds.pas
r456 r830 8 8 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 9 9 fPage, StdCtrls, Menus, ORCtrls, ORFn, ExtCtrls, ComCtrls, rOrders, uConst, 10 rMeds, ORNet ;10 rMeds, ORNet, fBase508Form, VA508AccessibilityManager; 11 11 12 12 type … … 83 83 mnuViewPostings: TMenuItem; 84 84 mnuOptimizeFields: TMenuItem; 85 SortbyStatusthenLocation1: TMenuItem; 86 SortbyClinicOrderthenStatusthenStopDate1: TMenuItem; 87 SortbyDrugalphabeticallystatusactivestatusrecentexpired1: TMenuItem; 88 N3: TMenuItem; 89 pnlView: TPanel; 90 txtView: TVA508StaticText; 85 91 procedure mnuChartTabClick(Sender: TObject); 86 92 procedure FormCreate(Sender: TObject); … … 136 142 procedure hdrMedsInMouseUp(Sender: TObject; Button: TMouseButton; 137 143 Shift: TShiftState; X, Y: Integer); 138 //procedure ActivateDeactiveRenew(AListBox: TListBox);144 procedure ActivateDeactiveRenew(AListBox: TListBox); 139 145 procedure ViewInfo(Sender: TObject); 140 146 procedure mnuViewInformationClick(Sender: TObject); … … 146 152 procedure hdrMedsInSectionClick(HeaderControl: THeaderControl; 147 153 Section: THeaderSection); 154 procedure SortbyStatusthenLocation1Click(Sender: TObject); 155 procedure SortbyClinicOrderthenStatusthenStopDate1Click( 156 Sender: TObject); 157 procedure SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click( 158 Sender: TObject); 148 159 private 149 160 FIterating: Boolean; … … 159 170 uNonVAOrdersOut: TStringList; 160 171 ChildODList: TStringList; 172 FSortView: integer; 161 173 function ListSelected(const ErrMsg: string): TListBox; 162 174 procedure ValidateSelected(AListBox: TListBox; const AnAction, WarningMsg, WarningTitle: string); … … 170 182 function GetMedList(Control: TWinControl): TList; 171 183 function GetPharmacyOrders(Control: TWinControl): TStringList; 172 function PatientStatusChanged: boolean;184 //function PatientStatusChanged: boolean; 173 185 procedure ClearChildODList; 186 procedure SetViewCaption(Caption : String); 187 procedure lstMedsInRightClickHandler(var Msg: TMessage; var Handled: Boolean); 188 procedure lstMedsNonVARightClickHandler(var Msg: TMessage; var Handled: Boolean); 189 procedure lstMedsOutRightClickHandler(var Msg: TMessage; var Handled: Boolean); 174 190 public 175 191 procedure RefreshMedLists; … … 184 200 function GetTotalSectionsWidth(Sender: TObject) : integer; 185 201 function CheckMedStatus(ActiveList: TListBox): boolean; 202 property SortView: integer read FSortView write FSortView; 186 203 end; 187 204 … … 223 240 uses uCore, rCore, fFrame, fRptBox, uOrders, fODBase, fOrdersDC, fOrdersHold, 224 241 fOrdersRenew, fOMNavA, fOrdersRefill, fMedCopy, fOrders, fODChild, rODBase, 225 StrUtils, fActivateDeactivate; 242 StrUtils, fActivateDeactivate, VA2006Utils, VA508AccessibilityRouter, 243 VAUtils; 226 244 227 245 {$R *.DFM} … … 532 550 begin 533 551 inherited; 552 FixHeaderControlDelphi2006Bug(hdrMedsIn); 553 FixHeaderControlDelphi2006Bug(hdrMedsOut); 554 FixHeaderControlDelphi2006Bug(hdrMedsNonVA); 534 555 PageID := CT_MEDS; 535 lstMedsIn.Color := ReadOnlyColor;536 lstMedsOut.Color := ReadOnlyColor;537 556 uMedListIn := TList.Create; 538 557 uMedListOut := TList.Create; … … 598 617 end; 599 618 //end CQ9622 619 AddMessageHandler(lstMedsIn, lstMedsInRightClickHandler); 620 AddMessageHandler(lstMedsNonVA, lstMedsNonVARightClickHandler); 621 AddMessageHandler(lstMedsOut, lstMedsOutRightClickHandler); 600 622 end; 601 623 … … 603 625 begin 604 626 inherited; 627 RemoveMessageHandler(lstMedsOut, lstMedsOutRightClickHandler); 628 RemoveMessageHandler(lstMedsNonVA, lstMedsNonVARightClickHandler); 629 RemoveMessageHandler(lstMedsIn, lstMedsInRightClickHandler); 605 630 ClearChildODList; 606 631 ClearMedList(uMedListIn); … … 641 666 if AnID <> '' then 642 667 begin 643 tmpList.Assign(DetailMedLM(AnID));668 FastAssign(DetailMedLM(AnID), tmpList); 644 669 end; 645 670 AnOrder := Piece(Strings[i], U, 2); … … 649 674 tmpList.Add(StringOfChar('=', 74)); 650 675 tmpList.Add(''); 651 tmpList.AddStrings(MedAdminHistory(AnOrder));676 FastAddStrings(MedAdminHistory(AnOrder), tmpList); 652 677 end; 653 678 if CheckOrderGroup(AnOrder)=1 then // if it's UD group … … 665 690 end; 666 691 if tmpList.Count > 0 then ReportBox(tmpList, ATitle, True); 667 if frmFrame.CCOWDrivedChange then692 if (frmFrame.TimedOut) or (frmFrame.CCOWDrivedChange) then Exit; //code added to correct access violation on timeout 668 693 Exit; 669 694 end; … … 704 729 procedure TfrmMeds.RefreshMedLists; 705 730 var 706 i : Integer;731 i,view: Integer; 707 732 AMed: TMedListRec; 708 733 begin … … 711 736 lstMedsNonVA.Clear; 712 737 StatusText('Retrieving active medications...'); 713 LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA); 738 view := self.FSortView; 739 //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 743 self.FSortView := view; 744 if view = 1 then 745 begin 746 self.SortbyStatusthenLocation1.Checked := True; 747 SetViewCaption(SortbyStatusthenLocation1.Caption); 748 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False; 749 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.checked := false; 750 end 751 else if view = 2 then 752 begin 753 self.SortbyStatusthenLocation1.Checked := False; 754 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True; 755 SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption); 756 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false; 757 end 758 else if view = 3 then 759 begin 760 self.SortbyStatusthenLocation1.Checked := False; 761 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false; 762 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true; 763 SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption); 764 end 765 end; 714 766 uPharmacyOrdersIn.Clear; 715 767 uPharmacyOrdersOut.Clear; … … 735 787 lstMedsOut.Items.AddObject(GetPlainText(lstMedsOut, i), AMed); 736 788 end; 737 789 738 790 StatusText(''); 739 791 end; … … 769 821 // replace pharmacy text with order text if this is a change 770 822 if CharAt(AnAction, 1) = 'X' then result := Piece(AnAction, U, 3); 771 if AMed.IVFluid then Indent := Pos( #10+ 'in ', result) else Indent := Pos(#13, result);823 if AMed.IVFluid then Indent := Pos(CRLF + 'in ', result) else Indent := Pos(#13, result); 772 824 if Indent > 0 then 773 825 begin 774 826 if AMed.IVFluid then 775 827 begin 776 Detail := Copy(result, Indent + 1, Length(result));828 Detail := Copy(result, Indent + Length(CRLF), Length(result)); 777 829 result := Copy(result, 1, Indent - 1); 778 830 end else … … 928 980 Canvas.Font.Color := clHighlightText; 929 981 //Canvas.FillRect(ARect); 930 Canvas.Font.Color := clWhite;982 Canvas.Font.Color := Get508CompliantColor(clWhite); 931 983 end; 932 if (C olorToRGB(clWindowText) = ColorToRGB(clBlack)) and (Canvas.Font.Color <> clWhite) then933 Canvas.Font.Color := clBlue;984 if (Canvas.Font.Color <> Get508CompliantColor(clWhite)) then 985 Canvas.Font.Color := Get508CompliantColor(clBlue); 934 986 if (Length(Piece(AnAction,'^',4)) > 0) then 935 987 AMed.Location := Piece(AnAction,'^',4); … … 981 1033 inherited; 982 1034 983 if PatientStatusChanged then exit;1035 //if PatientStatusChanged then exit; 984 1036 with lstMedsOut do for i := 0 to Items.Count -1 do 985 1037 Selected[i] := false; … … 988 1040 end; 989 1041 1042 procedure TfrmMeds.lstMedsInRightClickHandler(var Msg: TMessage; 1043 var Handled: Boolean); 1044 begin 1045 if Msg.Msg = WM_RBUTTONUP then 1046 begin 1047 lstMedsIn.RightClickSelect := (lstMedsIn.SelCount < 1); 1048 lstMedsInClick(lstMedsIn); 1049 end; 1050 end; 1051 990 1052 procedure TfrmMeds.lstMedsOutClick(Sender: TObject); 991 1053 var … … 994 1056 inherited; 995 1057 996 if PatientStatusChanged then exit;1058 //if PatientStatusChanged then exit; 997 1059 with lstMedsIn do for i := 0 to Items.Count -1 do 998 1060 Selected[i] := false; … … 1001 1063 end; 1002 1064 1065 procedure TfrmMeds.lstMedsOutRightClickHandler(var Msg: TMessage; 1066 var Handled: Boolean); 1067 begin 1068 if Msg.Msg = WM_RBUTTONUP then 1069 begin 1070 lstMedsOut.RightClickSelect := (lstMedsOut.SelCount < 1); 1071 lstMedsOutClick(lstMedsOut); 1072 end; 1073 end; 1074 1003 1075 procedure TfrmMeds.hdrMedsOutSectionResize(HeaderControl: THeaderControl; Section: THeaderSection); 1004 1076 begin … … 1035 1107 begin 1036 1108 inherited; 1037 if PatientStatusChanged then exit;1109 //if PatientStatusChanged then exit; 1038 1110 if lstMedsOut.SelCount > 0 then 1039 1111 begin … … 1071 1143 begin 1072 1144 ValidateSelected(ActiveList, OA_DC, TX_NO_DC, TC_NO_DC); 1073 //ActivateDeactiveRenew(ActiveList);AGP 26.53 TURN OFF UNTIL FINAL DECISION CAN BE MADE1145 ActivateDeactiveRenew(ActiveList); //AGP 26.53 TURN OFF UNTIL FINAL DECISION CAN BE MADE 1074 1146 MakeSelectedList(ActiveList, SelectedList); 1075 1147 if ExecuteDCOrders(SelectedList,DelEvt) then 1076 1148 begin 1149 if frmFrame.TimedOut = true then exit; 1077 1150 ResetSelectedForList(ActiveList); 1078 1151 SynchListToOrders(ActiveList, SelectedList); … … 1108 1181 if ExecuteHoldOrders(SelectedList) then 1109 1182 begin 1183 if frmFrame.TimedOut = true then exit; 1110 1184 AddSelectedToChanges(SelectedList); 1111 1185 ResetSelectedForList(ActiveList); … … 1114 1188 end; 1115 1189 finally 1116 ActiveList.SetFocus;1190 if frmFrame.TimedOut = false then ActiveList.SetFocus; 1117 1191 FIterating := False; 1118 1192 SelectedList.Free; … … 1152 1226 if ExecuteRenewOrders(SelectedList) then 1153 1227 begin 1228 if frmFrame.TimedOut = true then exit; 1154 1229 AddSelectedToChanges(SelectedList); 1155 1230 ResetSelectedForList(ActiveList); … … 1158 1233 end; 1159 1234 finally 1160 ActiveList.SetFocus;1235 if frmFrame.TimedOut = false then ActiveList.SetFocus; 1161 1236 FIterating := False; 1162 1237 SelectedList.Free; … … 1193 1268 if not ShowMsgOn(ChangeIFNList.Count = 0, TX_NOSEL, TC_NOSEL) 1194 1269 then ChangeOrders(ChangeIFNList, DelayEvent); 1270 if frmFrame.TimedOut = true then exit; 1195 1271 SynchListToOrders(ActiveList, SelectedList); // rehighlights 1196 1272 Activelist.SetFocus; … … 1225 1301 if (Length(AuthErr)>0) then 1226 1302 begin 1227 ShowM essage(AuthErr);1303 ShowMsg(AuthErr); 1228 1304 if not EncounterPresent then Exit; 1229 1305 end; … … 1241 1317 DoesDestEvtOccur := False; 1242 1318 ActiveList := ListSelected(TX_NOSEL); 1319 if not assigned(ActiveList) then exit; 1243 1320 if CheckMedStatus(ActiveList) = True then Exit; 1244 1321 if ActiveList = nil then Exit; … … 1343 1420 end; 1344 1421 end; 1422 if frmFrame.TimedOut = true then exit; 1345 1423 SynchListToOrders(ActiveList, SelectedList); // rehighlights 1346 1424 if IsTransferAction then … … 1352 1430 frmOrders.PtEvtCompleted(TempEvent.PtEventIFN,TempEvent.EventName,True); 1353 1431 finally 1354 ActiveList.SetFocus;1432 if frmFrame.TimedOut = false then ActiveList.SetFocus; 1355 1433 FActionOnMedsTab := False; 1356 1434 uAutoAC := False; … … 1411 1489 if ExecuteRefillOrders(SelectedList) then 1412 1490 begin 1491 if frmFrame.TimedOut = true then exit; 1413 1492 ResetSelectedForList(ActiveList); 1414 1493 SynchListToOrders(ActiveList, SelectedList); … … 1416 1495 end; 1417 1496 finally 1418 ActiveList.SetFocus;1497 if frmFrame.TimedOut = false then ActiveList.SetFocus; 1419 1498 FIterating := False; 1420 1499 SelectedList.Free; … … 1539 1618 begin 1540 1619 inherited; 1541 if PatientStatusChanged then exit;1620 //if PatientStatusChanged then exit; 1542 1621 end; 1543 1622 … … 1545 1624 begin 1546 1625 inherited; 1547 if PatientStatusChanged then exit;1626 //if PatientStatusChanged then exit; 1548 1627 end; 1549 1628 … … 1553 1632 begin 1554 1633 inherited; 1555 if PatientStatusChanged then exit;1634 //if PatientStatusChanged then exit; 1556 1635 with lstMedsIn do for i := 0 to Items.Count -1 do 1557 1636 Selected[i] := false; … … 1570 1649 inherited; 1571 1650 if not FIterating then ResetSelectedForList(TListBox(Sender)); 1651 end; 1652 1653 procedure TfrmMeds.lstMedsNonVARightClickHandler(var Msg: TMessage; 1654 var Handled: Boolean); 1655 begin 1656 if Msg.Msg = WM_RBUTTONUP then 1657 begin 1658 lstMedsNonVA.RightClickSelect := (lstMedsNonVA.SelCount < 1); 1659 lstMedsNonVAClick(lstMedsNonVA); 1660 end; 1572 1661 end; 1573 1662 … … 1725 1814 end; 1726 1815 1727 function TfrmMeds.PatientStatusChanged: boolean;1816 {function TfrmMeds.PatientStatusChanged: boolean; 1728 1817 const 1729 1818 … … 1752 1841 Result := True; 1753 1842 end; 1754 end; 1843 end;} 1755 1844 1756 1845 function TfrmMeds.GetTotalSectionsWidth(Sender: TObject) : integer; … … 1792 1881 for i := 0 to hdrMedsNonVA.Sections.Count - 1 do 1793 1882 OrigNonVASecWidths[i] := hdrMedsNonVA.Sections[i].Width; 1883 end; 1884 1885 procedure TfrmMeds.SetViewCaption(Caption: String); 1886 begin 1887 txtView.Caption := StringReplace(Caption,'&','',[rfReplaceAll]); 1794 1888 end; 1795 1889 … … 1946 2040 end; 1947 2041 1948 (*procedure TfrmMeds.ActivateDeactiveRenew(AListBox: TListBox);2042 procedure TfrmMeds.ActivateDeactiveRenew(AListBox: TListBox); 1949 2043 var 1950 2044 i: Integer; … … 1963 2057 end; 1964 2058 if tmpArr <> nil then frmActivateDeactive.fActivateDeactive(tmpArr, AListBox); 1965 end; *)2059 end; 1966 2060 1967 2061 procedure TfrmMeds.ViewInfo(Sender: TObject); … … 2052 2146 end; 2053 2147 2148 procedure TfrmMeds.SortbyStatusthenLocation1Click(Sender: TObject); 2149 begin 2150 inherited; 2151 self.FSortView := 1; 2152 self.SortbyStatusthenLocation1.Checked := True; 2153 SetViewCaption(SortbyStatusthenLocation1.Caption); 2154 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False; 2155 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false; 2156 self.RefreshMedLists; 2157 end; 2158 2159 procedure TfrmMeds.SortbyClinicOrderthenStatusthenStopDate1Click( 2160 Sender: TObject); 2161 begin 2162 inherited; 2163 self.FSortView := 2; 2164 self.SortbyStatusthenLocation1.Checked := False; 2165 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True; 2166 SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption); 2167 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false; 2168 self.RefreshMedLists; 2169 end; 2170 2171 procedure TfrmMeds.SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click( 2172 Sender: TObject); 2173 begin 2174 inherited; 2175 self.FSortView := 3; 2176 self.SortbyStatusthenLocation1.Checked := False; 2177 self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false; 2178 self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true; 2179 SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption); 2180 self.RefreshMedLists; 2181 end; 2182 2183 initialization 2184 SpecifyFormIsNotADialog(TfrmMeds); 2185 2054 2186 end. 2055 2187
Note:
See TracChangeset
for help on using the changeset viewer.