Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders/fODMedNVA.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/Orders/fODMedNVA.pas
r459 r460 1 1 unit fODMedNVA; 2 2 3 interface 3 interface 4 4 5 5 uses … … 41 41 Label2: TLabel; 42 42 btnSelect: TButton; 43 Image1: TImage; 44 memDrugMsg: TMemo; 43 45 procedure FormCreate(Sender: TObject); 44 46 procedure btnSelectClick(Sender: TObject); … … 68 70 procedure cboScheduleClick(Sender: TObject); 69 71 procedure cboRouteExit(Sender: TObject); 70 72 procedure DispOrderMessage(const AMessage: string); 71 73 72 74 … … 89 91 Change: TItemChange); 90 92 procedure FormKeyPress(Sender: TObject; var Key: Char); 93 91 94 private 92 95 {selection} … … 121 124 FPtInstruct: string; 122 125 FAltChecked: Boolean; 126 FShrinkDrugMsg: boolean; 123 127 FQOQuantity: Double; 124 128 FQODosage: string; … … 129 133 FDisabledCancelButton: TButton; 130 134 FShrinked: boolean; 135 FQOInitial: boolean; 131 136 FRemoveText : Boolean; 132 137 {selection} … … 291 296 TX_NO_FUTURE_DATES = 'Dates in the future are not allowed.'; 292 297 TX_BAD_DATE = 'Dates must be in the format mm/dd/yy or mm/yy'; 293 298 TX_CAP_FUTURE = 'Invalid date'; 294 299 295 300 { procedures inherited from fODBase --------------------------------------------------------- } … … 300 305 var 301 306 ListCount: Integer; 302 Restriction, x : string; 303 begin 307 Restriction, x: string; 308 begin 309 frmFrame.pnlVisit.Enabled := false; 304 310 AutoSizeDisabled := True; 305 311 // ActivateOrderDialog(Piece(DialogInfo, ';', 1), DelayEvent, Self, 0); 306 312 inherited; 313 AllowQuickOrder := True; 314 307 315 if User.OrderRole in[OR_CLERK] then // if user is clerk check restrictions else ok to write NonVA Order. 308 begin 309 CheckAuthForNVAMeds(Restriction); 310 if Length(Restriction) > 0 then 311 begin 312 InfoBox(Restriction, TC_RESTRICT, MB_OK); 313 Close; 314 Exit; 315 end; 316 end; 316 begin 317 CheckAuthForNVAMeds(Restriction); 318 if Length(Restriction) > 0 then 319 begin 320 CheckAuthForNVAMeds(Restriction); 321 if Length(Restriction) > 0 then 322 begin 323 InfoBox(Restriction, TC_RESTRICT, MB_OK); 324 Close; 325 Exit; 326 end; 327 end; 328 end; // clerk restrictions 317 329 318 330 if DlgFormID = OD_MEDNONVA then FNonVADlg := TRUE; … … 363 375 LoadOTCStatements(lbStatements.Items); 364 376 FRemoveText := True; 377 FShrinkDrugMsg := False; 365 378 end; 366 379 … … 376 389 // TAccessibleStringGrid.UnwrapControl(grdDoses); 377 390 inherited; 391 frmFrame.pnlVisit.Enabled := true; 378 392 end; 379 393 … … 401 415 procedure TfrmODMedNVA.SetupDialog(OrderAction: Integer; const ID: string); 402 416 var 417 //AnInstr: string; 403 418 OrderID: string; 404 419 begin … … 429 444 Changing := False; 430 445 end; 431 446 { prevent the SIG from being part of the comments on pre-CPRS prescriptions } 447 {if (OrderAction in [ORDER_COPY, ORDER_EDIT]) and (cboDosage.Text = '') then //commented out by cla 2/27/04 - CQ 2591 448 begin 449 OrderID := Copy(Piece(ID, ';', 1), 2, Length(ID)); 450 AnInstr := TextForOrder(OrderID); 451 pnlMessage.TabOrder := 0; 452 OrderMessage(AnInstr); 453 if OrderAction = ORDER_COPY 454 then AnInstr := 'Copy: ' + AnInstr 455 else AnInstr := 'Change: ' + AnInstr; 456 Caption := AnInstr; 457 memComment.Clear; // sometimes the sig is in the comment 458 lbStatements.Clear; 459 end;} 432 460 ControlChange(Self); 433 461 end; … … 527 555 end; 528 556 529 530 557 { Navigate medication selection lists ------------------------------------------------------- } 531 558 … … 607 634 var 608 635 Offset: Integer; 636 SelRect: TRect; 609 637 begin 610 638 AListView.Selected.MakeVisible(FALSE); 639 SelRect := AListView.Selected.DisplayRect(drBounds); // CQ: 6636 640 FRowHeight := SelRect.Bottom - SelRect.Top; 611 641 Offset := AListView.Selected.Index - AListView.TopItem.Index; 612 642 Application.ProcessMessages; … … 803 833 Changing := True; 804 834 ResetOnMedChange; 805 if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then // orderable item 835 if (FActiveMedList = lstQuick) and (lstQuick.Selected <> nil) then // quick order 836 begin 837 ErrMsg := ''; 838 FIsQuickOrder := True; 839 FQOInitial := True; 840 Responses.QuickOrder := Integer(lstQuick.Selected.Data); 841 txtMed.Tag := StrToIntDef(Responses.IValueFor('ORDERABLE', 1), 0); 842 IsActivateOI(ErrMsg, txtMed.Tag); 843 if Length(ErrMsg)>0 then 844 begin 845 //btnSelect.Visible := False; 846 btnSelect.Enabled := False; 847 ShowMessage(ErrMsg); 848 Exit; 849 end; 850 if txtMed.Tag = 0 then 851 begin 852 //btnSelect.Visible := False; 853 btnSelect.Enabled := False; 854 txtMed.SetFocus; 855 Exit; 856 end; 857 SetOnMedSelect; // set up for this medication 858 SetOnQuickOrder; // insert quick order responses 859 ShowMedFields; 860 end 861 else if (FActiveMedList = lstAll) and (lstAll.Selected <> nil) then // orderable item 806 862 begin 807 863 MedIEN := Integer(lstAll.Selected.Data); … … 831 887 ShowMedFields; 832 888 end 833 else 889 else // no selection 834 890 begin 835 891 MessageBeep(0); … … 842 898 else ShowMedSelect; // show the selection fields 843 899 FNoZERO := False; 844 845 900 end; 846 901 … … 848 903 begin 849 904 cboDosage.Items.Clear; 905 chkPRN.Checked := False; 906 cboSchedule.ItemIndex := -1; 907 cboSchedule.Text := ''; // leave items intact 908 memComment.Lines.Clear; 850 909 cboDosage.Text := ''; 851 910 cboRoute.Items.Clear; … … 867 926 QOPiUnChk := False; 868 927 PKIEnviron := False; 869 if GetPKISite and GetPKIUse then //PKI check for crypto object on workstation 870 begin 871 try //PKI object creation 872 crypto := CoXuDigSigS.Create; 873 crypto.GetCSP; 874 StatusText(crypto.Reason); 875 PKIEnviron := True; 876 except 877 on E: Exception do 878 begin 879 {ShowMessage('An error has been encountered while trying to create PKI environment: '+ E.Message + 880 '. This order will be processed without Digital Signature encryption.');} 881 PKIEnviron := False; 882 end; 883 end; 884 crypto := nil; 885 end; 886 if PKIEnviron = False then 887 if GetPKISite then PKIEnviron := True; 928 if GetPKISite then PKIEnviron := True; 888 929 with CtrlInits do 889 930 begin … … 950 991 // end; 951 992 pnlMessage.TabOrder := cboDosage.TabOrder + 1; 952 OrderMessage(TextOf('Message')); 993 994 // DispOrderMessage(TextOf('Message')); 953 995 end; 954 996 end; … … 971 1013 with cboDosage do 972 1014 if ItemIndex > -1 then x := Text + TAB + Items[ItemIndex] else x := Text; 1015 973 1016 SetControl(cboRoute, 'ROUTE', i); 974 1017 with cboRoute do … … 1001 1044 else 1002 1045 SetDosage(IValueFor('INSTR', 1)); 1003 SetControl(cbo Route, 'ROUTE', 1);1046 SetControl(cboDosage, 'DOSAGE', 1); // CQ: HDS00007776 1004 1047 SetSchedule(IValueFor('SCHEDULE', 1)); 1005 1048 if (cboSchedule.Text = '') and FIsQuickOrder then … … 1174 1217 NonPRNPart: string; 1175 1218 begin 1219 1176 1220 cboSchedule.ItemIndex := -1; 1177 1221 if Pos('PRN', x) > 0 then … … 1179 1223 NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1)); 1180 1224 cboSchedule.SelectByID(NonPRNPart); 1181 if cboSchedule.ItemIndex > -1 then chkPRN.Checked := True else 1182 begin 1183 cboSchedule.SelectByID(x); 1184 if cboSchedule.ItemIndex < 0 then cboSchedule.Text := x; 1185 end; 1225 if cboSchedule.ItemIndex < 0 then 1226 begin 1227 if NSSchedule then 1228 begin 1229 chkPRN.Checked := False; 1230 cboSchedule.Text := ''; 1231 end else 1232 begin 1233 chkPRN.Checked := True; 1234 cboSchedule.Items.Add(NonPRNPart); 1235 cboSchedule.Text := NonPRNPart; 1236 end; 1237 end else 1238 chkPRN.Checked := True; 1186 1239 end else 1187 1240 begin 1188 1241 chkPRN.Checked := False; 1189 1242 cboSchedule.SelectByID(x); 1190 if cboSchedule.ItemIndex < 0 then cboSchedule.Text := x; 1243 if cboSchedule.ItemIndex < 0 then 1244 begin 1245 if NSSchedule then 1246 begin 1247 cboSchedule.Text := ''; 1248 end 1249 else 1250 begin 1251 cboSchedule.Items.Add(x); 1252 cboSchedule.Text := x; 1253 cboSchedule.SelectByID(x); 1254 end; 1255 end; 1191 1256 end; 1192 1257 end; … … 1246 1311 var 1247 1312 DispDrug: Integer; 1248 x: string; 1249 begin 1250 inherited; 1251 UpdateRelated(False); 1313 begin 1314 inherited; 1315 UpdateRelated(False); 1252 1316 DispDrug := StrToIntDef(ValueOf(FLD_DRUG_ID), 0); 1253 1317 if cboDosage.Text = '' then //cla 3/18/04 … … 1256 1320 cboDosage.ItemIndex := -1; 1257 1321 end; 1322 { hds8084 1258 1323 if DispDrug > 0 then 1259 1324 begin 1260 1325 if not FSuppressMsg then begin 1261 1326 pnlMessage.TabOrder := cboDosage.TabOrder + 1; 1262 OrderMessage(DispenseMessage(DispDrug));1327 DispOrderMessage(DispenseMessage(DispDrug)); 1263 1328 end; 1264 1329 x := QuantityMessage(DispDrug); 1265 1330 end 1266 1331 else x := ''; 1332 } 1267 1333 with cboDosage do 1268 1334 if (ItemIndex > -1) and (Piece(Items[ItemIndex], U, 3) = 'NF') … … 1589 1655 then Responses.Update('ROUTE', 1, ValueOf(FLD_ROUTE_ID), x) 1590 1656 else Responses.Update('ROUTE', 1, '', x); 1591 // x := ValueOf(FLD_SCHEDULE); Responses.Update('SCHEDULE', 1, x, x);1657 x := ValueOf(FLD_SCHEDULE); Responses.Update('SCHEDULE', 1, x, x); // CQ:7297, 7534 1592 1658 end; 1593 1659 end; {case TabDose.TabIndex} … … 1598 1664 if Length(calStart.Text) > 0 then 1599 1665 Responses.Update('START', 1, calStart.Text, 'Start Date: ' + calStart.Text); //cla 7-17-03 1600 1666 1601 1667 x := ValueOf(FLD_STATEMENTS); 1602 1668 Responses.Update('STATEMENTS',1, TX_WPTYPE, x); … … 1697 1763 if ItemIndex > -1 then Result := Piece(Items[ItemIndex], U, 4); 1698 1764 FLD_SCHEDULE : begin 1699 Result := cboSchedule.Text;1765 Result := UpperCase(cboSchedule.Text); 1700 1766 if chkPRN.Checked then Result := Result + ' PRN'; 1701 1767 if UpperCase(Copy(Result, Length(Result) - 6, Length(Result))) = 'PRN PRN' … … 1768 1834 if Length(CurSchedule)=0 then Exit; 1769 1835 ASchedule := Trim(CurSchedule); 1770 if (Pos('^',ASchedule)=0) then1836 {if (Pos('^',ASchedule)=0) then //GE CQ7506 1771 1837 begin 1772 1838 PrnPos := Pos('PRN',ASchedule); 1773 1839 if (PrnPos > 1) and (CharAt(ASchedule,PrnPos-1) <> ';') then 1774 1840 Delete(ASchedule, PrnPos, Length(ASchedule)); 1775 end 1776 elseif (Pos('^',ASchedule)>0) then1841 end } 1842 if (Pos('^',ASchedule)>0) then 1777 1843 begin 1778 1844 PrnPos := Pos('PRN',ASchedule); … … 1929 1995 begin 1930 1996 Val(TabletNum, ie, code); 1997 if ie = 0 then begin end; 1931 1998 if code <> 0 then 1932 1999 Exit; … … 1967 2034 1968 2035 procedure TfrmODMedNVA.chkPRNClick(Sender: TObject); 1969 begin 1970 inherited; 1971 if chkPRN.Checked then lblAdminTime.Caption := '' 2036 var 2037 tempSch: string; 2038 PRNPos: integer; 2039 begin 2040 inherited; 2041 {if chkPRN.Checked then lblAdminTime.Caption := '' 1972 2042 else 1973 2043 begin 1974 2044 lblAdminTime.Caption := FAdminTimeLbl; 2045 end; 2046 ControlChange(Self); 2047 } 2048 if chkPRN.Checked then 2049 begin 2050 lblAdminTime.Caption := ''; 2051 PrnPos := Pos('PRN',cboSchedule.Text); 2052 if (PrnPos < 1) then 2053 UpdateStartExpires(cboSchedule.Text + ' PRN'); 2054 end 2055 else 2056 begin 2057 if Length(Trim(cboSchedule.Text))>0 then 2058 begin 2059 tempSch := ';'+Trim(cboSchedule.Text); 2060 UpdateStartExpires(tempSch); 2061 end; 2062 lblAdminTime.Caption := FAdminTimeLbl; 2063 1975 2064 end; 1976 2065 ControlChange(Self); … … 2194 2283 end; 2195 2284 2285 procedure TfrmODMedNVA.DispOrderMessage(const AMessage: string); 2286 begin 2287 if ContainsVisibleChar(AMessage) then 2288 begin 2289 image1.Visible := True; 2290 memDrugMsg.Visible := True; 2291 image1.Picture.Icon.Handle := LoadIcon(0, IDI_ASTERISK); 2292 memDrugMsg.Lines.Clear; 2293 memDrugMsg.Lines.SetText(PChar(AMessage)); 2294 if fShrinkDrugMsg then 2295 begin 2296 pnlBottom.Height := pnlBottom.Height + memDrugMsg.Height + 2; 2297 fShrinkDrugMsg := False; 2298 end; 2299 end else 2300 begin 2301 image1.Visible := False; 2302 memDrugMsg.Visible := False; 2303 if not fShrinkDrugMsg then 2304 // begin 2305 // pnlBottom.Height := pnlBottom.Height - memDrugMsg.Height - 2; 2306 fShrinkDrugMsg := True; 2307 // end; 2308 end; 2309 end; 2310 2196 2311 end.
Note:
See TracChangeset
for help on using the changeset viewer.