- Timestamp:
- May 8, 2015, 7:52:55 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/HealthSevak-CPRS/CPRS-Chart/Consults/fODConsult.pas
r829 r1693 9 9 fODBase, StdCtrls, ORCtrls, ExtCtrls, ComCtrls, ORfn, uConst, Buttons, 10 10 Menus, UBAGlobals, rOrders, fBALocalDiagnoses, UBAConst, UBACore, ORNet, 11 VA508AccessibilityManager ;11 ORDtTm, VA508AccessibilityManager ; 12 12 13 13 type 14 14 TfrmODCslt = class(TfrmODBase) 15 pnlMain: TPanel; 16 lblService: TLabel; 17 lblProvDiag: TLabel; 18 lblUrgency: TLabel; 19 lblPlace: TLabel; 20 lblAttn: TLabel; 21 lblLatest: TStaticText; 22 lblEarliest: TStaticText; 23 pnlReason: TPanel; 24 lblReason: TLabel; 25 memReason: TRichEdit; 15 26 cboService: TORComboBox; 16 27 cboUrgency: TORComboBox; … … 18 29 txtProvDiag: TCaptionEdit; 19 30 txtAttn: TORComboBox; 20 lblService: TLabel;21 lblUrgency: TLabel;22 lblPlace: TLabel;23 lblAttn: TLabel;24 lblProvDiag: TLabel;25 31 treService: TORTreeView; 26 32 cboCategory: TORComboBox; 27 33 pnlServiceTreeButton: TKeyClickPanel; 28 34 btnServiceTree: TSpeedButton; 35 gbInptOpt: TGroupBox; 36 radInpatient: TRadioButton; 37 radOutpatient: TRadioButton; 38 btnDiagnosis: TButton; 39 cmdLexSearch: TButton; 40 calEarliest: TORDateBox; 41 calLatest: TORDateBox; 29 42 mnuPopProvDx: TPopupMenu; 30 43 mnuPopProvDxDelete: TMenuItem; 31 cmdLexSearch: TButton;32 44 popReason: TPopupMenu; 33 45 popReasonCut: TMenuItem; … … 36 48 popReasonPaste2: TMenuItem; 37 49 popReasonReformat: TMenuItem; 38 gbInptOpt: TGroupBox; 39 radInpatient: TRadioButton; 40 radOutpatient: TRadioButton; 41 pnlReason: TPanel; 42 lblReason: TLabel; 43 memReason: TRichEdit; 44 btnDiagnosis: TButton; 50 pnlCombatVet: TPanel; 51 txtCombatVet: TVA508StaticText; 52 servicelbl508: TVA508StaticText; 45 53 procedure FormCreate(Sender: TObject); 46 54 procedure txtAttnNeedData(Sender: TObject; const StartFrom: String; … … 96 104 FEditCtrl: TCustomEdit; 97 105 FNavigatingTab: boolean; 106 LLS_LINE_INDEX: integer; 98 107 procedure BuildQuickTree(QuickList: TStrings; const Parent: string; Node: TTreeNode); 99 108 procedure ReadServerVariables; … … 107 116 procedure SetUpCopyConsultDiagnoses(pOrderID:string); 108 117 procedure AdjustMemReasonSize; 118 function NotinIndex(AList: TStringList; i: integer): boolean; 119 function GetItemIndex(Service: String; Index: integer): integer; 120 procedure SetUpCombatVet; 121 procedure SetUpEarliestDate; //wat v28 122 procedure setup508Label(lbl: TVA508StaticText; ctrl: TORComboBox); 109 123 protected 110 124 procedure InitDialog; override; … … 123 137 124 138 139 function CanFreeConsultDialog(dialog : TfrmODBase) : boolean; 140 125 141 implementation 126 142 … … 129 145 uses 130 146 rODBase, rConsults, uCore, uConsults, rCore, fConsults, fPCELex, rPCE, fPreReq, 131 ORClasses, clipbrd, uTemplates, fFrame, uODBase, uVA508CPRSCompatibility; 147 ORClasses, clipbrd, uTemplates, fFrame, uODBase, uVA508CPRSCompatibility, 148 VA508AccessibilityRouter; 132 149 133 150 var … … 137 154 BADxUpdated: boolean; 138 155 quickCode: string; 139 156 AreGlobalsFree: boolean; 140 157 141 158 … … 156 173 TX_INACTIVE_CODE_REQD = 'Another code must be selected before the order can be saved.'; 157 174 TX_INACTIVE_CODE_OPTIONAL = 'If another code is not selected, no code will be saved.'; 175 TX_PAST_DATE = 'Earliest appropriate date must be today or later.'; 176 TX_BAD_DATES = 'Latest appropriate date must be equal to or later than earliest date.'; 158 177 159 178 TX_SVC_HRCHY = 'services/specialties hierarchy'; 160 179 TX_VIEW_SVC_HRCHY = 'View services/specialties hierarchically'; 161 180 TX_CLOSE_SVC_HRCHY = 'Close services/specialties hierarchy tree view'; 181 182 183 {************** Static Unit Methods ***************} 184 185 function CanFreeConsultDialog(dialog : TfrmODBase) : boolean; 186 begin 187 Result := true; 188 if (dialog is TfrmODCslt) then 189 Result := AreGlobalsFree; 190 end; 191 192 procedure InitializeGlobalLists; 193 begin 194 Defaults := TStringList.Create; 195 SvcList := TStringList.Create; 196 QuickList := TStringList.Create; 197 AreGlobalsFree := false; 198 end; 199 200 function FreeGlobalLists : Boolean; 201 begin 202 Result := false; 203 if AreGlobalsFree then 204 Exit; 205 Defaults.Free; 206 SvcList.Free; 207 QuickList.Free; 208 AreGlobalsFree := true; 209 Result := true; 210 end; 211 212 {*************** TfrmODCslt Methods ***********} 162 213 163 214 procedure TfrmODCslt.FormCreate(Sender: TObject); … … 176 227 cmdLexSearch.Visible := True; 177 228 end; 178 Defaults := TStringList.Create ; 179 SvcList := TStringList.Create ; 180 QuickList := TStringList.Create ; 229 InitializeGlobalLists; 181 230 AllowQuickOrder := True; 182 231 LastNode := 0; … … 190 239 FastAssign(ODForConsults, Defaults); // ODForConsults returns TStrings with defaults 191 240 CtrlInits.LoadDefaults(Defaults); 241 calEarliest.Text := 'TODAY'; 242 //calLatest.Text := 'TODAY+30'; 192 243 txtAttn.InitLongList('') ; 193 244 PreserveControl(txtAttn); 245 PreserveControl(calEarliest); 246 //PreserveControl(calLatest); 247 if (patient.CombatVet.IsEligible = True) then 248 begin 249 SetUpCombatVet; 250 end 251 else 252 begin 253 txtCombatVet.Enabled := False; 254 pnlCombatVet.SendToBack; 255 end; 194 256 InitDialog; 195 257 //Calling virtual SetFontSize in constructor is a bad idea! … … 197 259 FcboServiceKeyDownStopClick := false; 198 260 consultQuickOrder := false; 199 200 201 261 end; 202 262 … … 233 293 memReason.Clear; 234 294 cboService.Enabled := True; 295 setup508Label(servicelbl508, cboService); 235 296 cboService.Font.Color := clWindowText; 236 cboService.Height := 25 + ( 7* cboService.ItemHeight);297 cboService.Height := 25 + (11 * cboService.ItemHeight); 237 298 btnServiceTree.Enabled := True; 238 299 pnlServiceTreeButton.Enabled := True; 239 300 SetProvDiagPromptingMode; 240 ActiveControl := cboService; // set after call to SetProvDiagPromptingMode 301 ActiveControl := cboService; 302 241 303 Changing := False; 242 304 StatusText(''); … … 258 320 begin 259 321 inherited; 322 LLS_LINE_INDEX := -1; 260 323 ReadServerVariables; 261 324 AList := TStringList.Create; … … 281 344 Exit; 282 345 end; 346 283 347 cboService.Items.Add(SvcIEN + U + tmpResp.EValue + '^^^^' + tmpResp.IValue); 284 348 cboService.SelectByID(SvcIEN); … … 289 353 else 290 354 radOutpatient.Checked := True ; 291 SetControl(cboUrgency, 'URGENCY', 1); 355 SetUpEarliestDate; //wat v28 356 SetControl(cboUrgency, 'URGENCY', 1); 292 357 SetControl(cboPlace, 'PLACE', 1); 293 358 SetControl(txtAttn, 'PROVIDER', 1); 359 SetControl(calEarliest, 'EARLIEST', 1); 360 //SetControl(calLatest, 'LATEST', 1); 294 361 cboService.Enabled := False; 362 setup508Label(servicelbl508, cboService); 295 363 cboService.Font.Color := clGrayText; 296 364 btnServiceTree.Enabled := False; … … 308 376 begin 309 377 AbortOrder := True; 378 SetTemplateDialogCanceled(FALSE); 310 379 Close; 311 380 Exit; … … 316 385 begin 317 386 AbortOrder := True; 387 SetTemplateDialogCanceled(FALSE); 318 388 Close; 319 389 Exit; … … 343 413 FastAssign(QuickList, cboService.Items); 344 414 Items.Add(LLS_LINE); 415 LLS_LINE_INDEX := Items.IndexOf(Trim(Piece(LLS_LINE, U, 2))); {TP - HDS00015782: Used to determine if QO} 345 416 Items.Add(LLS_SPACE); 346 417 end; 347 418 Changing := True; 348 419 for i := 0 to AList.Count - 1 do 349 if (cboService.Items.IndexOf(Trim(Piece(AList.Strings[i], U, 2))) = -1) and {RV} 420 //if (cboService.Items.IndexOf(Trim(Piece(AList.Strings[i], U, 2))) = -1) and {RV} 421 if (NotinIndex(AList,i)) and {TP - HDS00015782: Check if service is already in index (not including QO)} 350 422 //if (cboService.SelectByID(Piece(AList.Strings[i], U, 1)) = -1) and 351 423 (Piece(AList.Strings[i], U, 5) <> '1') then … … 410 482 SetError(TX_SELECT_DIAG); 411 483 end; 484 if (lblEarliest.Enabled) and (calEarliest.FMDateTime < FMToday) then SetError(TX_PAST_DATE); 485 //if calLatest.FMDateTime < FMToday then SetError(TX_PAST_DATE); 486 //if calLatest.FMDateTime < calEarliest.FMDateTime then SetError(TX_BAD_DATES); 412 487 end; 413 488 … … 548 623 FLastServiceID := ItemID; 549 624 cboService.Enabled := False; 625 setup508Label(servicelbl508, cboService); 550 626 cboService.Font.Color := clGrayText; 551 627 btnServiceTree.Enabled := False; … … 588 664 SetControl(cboPlace, 'PLACE', 1); 589 665 SetControl(txtAttn, 'PROVIDER', 1); 666 SetControl(calEarliest, 'EARLIEST', 1); 667 //SetControl(calLatest, 'LATEST', 1); 590 668 SetTemplateDialogCanceled(FALSE); 591 669 SetControl(memReason, 'COMMENT', 1); … … 593 671 begin 594 672 AbortOrder := TRUE; 673 SetTemplateDialogCanceled(FALSE); 595 674 Close; 596 675 Exit; … … 616 695 end; 617 696 SetProvDiagPromptingMode; 697 SetUpEarliestDate; //wat v28 618 698 tmpSvc := Piece(cboService.Items[cboService.ItemIndex], U, 6); 619 699 pnlMessage.TabOrder := treService.TabOrder + 1; … … 646 726 else Responses.Update('ORDERABLE', 1, '', ''); 647 727 end; 648 with memReason do if GetTextLen > 0 then Responses.Update('COMMENT', 1, TX_WPTYPE, Text); 649 with cboCategory do if ItemID <> '' then Responses.Update('CLASS', 1, ItemID, Text); 650 with cboUrgency do if ItemIEN > 0 then Responses.Update('URGENCY', 1, ItemID, Text); 651 with cboPlace do if ItemID <> '' then Responses.Update('PLACE', 1, ItemID, Text); 652 with txtAttn do if ItemIEN > 0 then Responses.Update('PROVIDER', 1, ItemID, Text); 728 with memReason do Responses.Update('COMMENT', 1, TX_WPTYPE, Text); 729 with cboCategory do Responses.Update('CLASS', 1, ItemID, Text); 730 with cboUrgency do Responses.Update('URGENCY', 1, ItemID, Text); 731 with cboPlace do Responses.Update('PLACE', 1, ItemID, Text); 732 with txtAttn do Responses.Update('PROVIDER', 1, ItemID, Text); 733 with calEarliest do if Length(Text) > 0 then Responses.Update('EARLIEST', 1, Text, Text); 734 //with calLatest do if Length(Text) > 0 then Responses.Update('LATEST', 1, Text, Text); 653 735 //with txtProvDiag do if Length(Text) > 0 then Responses.Update('MISC', 1, Text, Text); 654 736 if Length(ProvDx.Text) > 0 then Responses.Update('MISC', 1, ProvDx.Text, ProvDx.Text) … … 758 840 with cboService do 759 841 begin 842 setup508Label(servicelbl508, cboService); 760 843 if (ItemIndex < 0) or (ItemID = '') then 761 844 begin … … 779 862 Changing := True; 780 863 Responses.QuickOrder := ExtractInteger(ItemID); 781 consultQuickOrder := True; 864 consultQuickOrder := True; 782 865 tmpSvc := TResponse(Responses.FindResponseByName('ORDERABLE',1)).EValue; 783 866 ItemIndex := Items.IndexOf(Trim(tmpSvc)); 867 If ItemIndex < LLS_LINE_INDEX then {TP - HDS00015782: Check if index is of a QO} 868 ItemIndex := GetItemIndex(tmpSvc,ItemIndex); 784 869 (* tmpSvc := TResponse(Responses.FindResponseByName('ORDERABLE',1)).IValue; 785 870 for i := 0 to Items.Count-1 do … … 793 878 FLastServiceID := ItemID; 794 879 Enabled := False; 880 setup508Label(servicelbl508, cboService); 795 881 Font.Color := clGrayText; 796 882 btnServiceTree.Enabled := False; … … 811 897 SetControl(cboPlace, 'PLACE', 1); 812 898 SetControl(txtAttn, 'PROVIDER', 1); 899 SetControl(calEarliest, 'EARLIEST', 1); 900 //SetControl(calLatest, 'LATEST', 1); 813 901 SetTemplateDialogCanceled(FALSE); 814 902 SetControl(memReason, 'COMMENT', 1); … … 816 904 begin 817 905 AbortOrder := TRUE; 906 SetTemplateDialogCanceled(FALSE); 818 907 Close; 819 908 Exit; … … 861 950 //OrderMessage(ConsultMessage(cboService.ItemIEN)); 862 951 ControlChange(Self) ; 952 SetUpEarliestDate; //wat v28 953 setup508Label(servicelbl508, cboService); 863 954 end; 864 955 865 956 procedure TfrmODCslt.FormDestroy(Sender: TObject); 866 957 begin 867 Defaults.Free; 868 SvcList.Free ; 869 QuickList.Free; 958 if not FreeGlobalLists then 959 Exit; 870 960 inherited; 871 961 end; … … 986 1076 ProvDx.Text := Copy(ProvDx.Text, 1, i - 1); 987 1077 txtProvDiag.Text := ProvDx.Text + ' (' + ProvDx.Code + ')'; 988 989 1078 ProvDx.CodeInactive := False; 990 1079 end; … … 1057 1146 1058 1147 1148 procedure TfrmODCslt.setup508Label(lbl: TVA508StaticText; ctrl: TORComboBox); 1149 begin 1150 if ScreenReaderSystemActive and not ctrl.Enabled then begin 1151 lbl.Enabled := True; 1152 lbl.Visible := True; 1153 lbl.Caption := lblService.Caption + ', ' + ctrl.Text; 1154 lbl.Width := (ctrl.Left + ctrl.Width) - lbl.Left; 1155 end else 1156 lbl.Visible := false; 1157 end; 1158 1059 1159 procedure TfrmODCslt.mnuPopProvDxDeleteClick(Sender: TObject); 1060 1160 begin … … 1493 1593 pnlReason.Top := cboService.Top + cboService.Height + PIXEL_SPACE; 1494 1594 pnlReason.Height := memOrder.Top - pnlReason.Top - PIXEL_SPACE; 1595 if patient.CombatVet.IsEligible then pnlReason.Height := pnlReason.Height - PIXEL_SPACE*20; 1596 end; 1597 1598 function TfrmODCslt.NotinIndex(AList: TStringList; i: integer): Boolean; {TP - HDS00015782:} 1599 {This function determines if a Consult Service will be added to the cboService 1600 component. If name does not exist or if name does not exist below the Quick 1601 Order listing, then it is added.} 1602 var 1603 x: Integer; 1604 y: String; 1605 begin 1606 Result := False; 1607 x := cboService.Items.IndexOf(Trim(Piece(AList.Strings[i], U, 2))); 1608 if (x = -1) then 1609 Result := True; 1610 if (x <> -1) and (x < LLS_LINE_INDEX) then 1611 begin 1612 y := cboService.Items[x]; 1613 cboService.Items.Delete(x); 1614 if (cboService.Items.IndexOf(Trim(Piece(AList.Strings[i], U, 2))) = -1) then 1615 Result := True; 1616 cboService.Items.Insert(x,y); 1617 end; 1618 1619 end; 1620 1621 function TfrmODCslt.GetItemIndex(Service: String; Index: integer): integer; {TP - HDS00015782:} 1622 {This function returns ItemIndexOf value for Service Consult when a Quick Order 1623 has the exact same name} 1624 var 1625 y: String; 1626 1627 begin 1628 y := cboService.Items[Index]; 1629 cboService.Items.Delete(Index); 1630 Result := (cboService.Items.IndexOf(Trim(Service)) + 1); 1631 cboService.Items.Insert(Index,y); 1632 end; 1633 1634 procedure TfrmODCslt.SetUpCombatVet; 1635 begin 1636 pnlCombatVet.BringToFront; 1637 txtCombatVet.Enabled := True; 1638 txtCombatVet.Caption := 'Combat Veteran Eligibility Expires on ' + patient.CombatVet.ExpirationDate; 1639 pnlMain.Top := pnlMain.Top + pnlCombatVet.Height; 1640 pnlMain.Anchors := [akLeft,akTop,akRight]; 1641 treService.Anchors := [akLeft,akTop,akRight]; 1642 self.Height := self.Height + pnlCombatVet.Height; 1643 treService.Anchors := [akLeft,akTop,akRight,akBottom]; 1644 pnlMain.Anchors := [akLeft,akTop,akRight,akBottom]; 1645 end; 1646 1647 procedure TfrmODCslt.SetUpEarliestDate; //wat v28 1648 begin 1649 if IsProstheticsService(cboService.ItemIEN) = '1' then 1650 begin 1651 lblEarliest.Enabled := False; 1652 calEarliest.Enabled := False; 1653 calEarliest.Text := ''; 1654 Responses.Update('EARLIEST',1,'',''); 1655 end 1656 else 1657 begin 1658 lblEarliest.Enabled := True; 1659 calEarliest.Enabled := True; 1660 calEarliest.Text := 'TODAY'; 1661 end; 1495 1662 end; 1496 1663
Note:
See TracChangeset
for help on using the changeset viewer.