Changeset 1693 for cprs/branches/HealthSevak-CPRS/CPRS-Chart/fARTAllgy.pas
- Timestamp:
- May 8, 2015, 7:52:55 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/HealthSevak-CPRS/CPRS-Chart/fARTAllgy.pas
r830 r1693 1 1 unit fARTAllgy; 2 2 3 3 interface 4 4 … … 21 21 lblAgent: TOROffsetLabel; 22 22 lstAllergy: TORListBox; 23 btnAgent : TSpeedButton;23 btnAgent1: TSpeedButton; 24 24 lblOriginator: TOROffsetLabel; 25 25 cboOriginator: TORComboBox; … … 33 33 calVerifyDate: TORDateBox; 34 34 lblVerifyDate: TOROffsetLabel; 35 dlgReactionDateTime: TORDateTimeDlg;36 35 Bevel1: TBevel; 37 36 lblSymptoms: TOROffsetLabel; … … 39 38 lblSelectedSymptoms: TOROffsetLabel; 40 39 lstSelectedSymptoms: TORListBox; 41 btnDateTime: TButton;42 40 btnRemove: TButton; 43 41 grpObsHist: TRadioGroup; … … 60 58 lblNatureOfReaction: TOROffsetLabel; 61 59 btnSevHelp: TORAlignButton; 62 procedure btnAgentClick(Sender: TObject); 63 procedure FormCreate(Sender: TObject); 60 VA508ComponentAccessibility1: TVA508ComponentAccessibility; 61 VA508ComponentAccessibility2: TVA508ComponentAccessibility; 62 origlbl508: TVA508StaticText; 63 origdtlbl508: TVA508StaticText; 64 SymptomDateBox: TORDateBox; 65 btnAgent: TButton; 66 VA508ComponentAccessibility3: TVA508ComponentAccessibility; 67 NoAllergylbl508: TVA508StaticText; 68 procedure btnAgent1Click(Sender: TObject); 69 procedure FormCreate(Sender: TObject); 64 70 procedure cboOriginatorNeedData(Sender: TObject; const StartFrom: String; 65 71 Direction, InsertAt: Integer); … … 77 83 procedure btnRemoveClick(Sender: TObject); 78 84 procedure lstAllergyClick(Sender: TObject); 79 procedure btnDateTimeClick(Sender: TObject);80 85 procedure cboSymptomsMouseClick(Sender: TObject); 81 86 procedure cboSymptomsKeyDown(Sender: TObject; var Key: Word; … … 90 95 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 91 96 procedure btnSevHelpClick(Sender: TObject); 97 procedure VA508ComponentAccessibility1StateQuery(Sender: TObject; 98 var Text: string); 99 procedure VA508ComponentAccessibility2ValueQuery(Sender: TObject; 100 var Text: string); 101 procedure VA508ComponentAccessibility2StateQuery(Sender: TObject; 102 var Text: string); 103 procedure VA508ComponentAccessibility2ItemInstructionsQuery(Sender: TObject; 104 var Text: string); 105 procedure VA508ComponentAccessibility2ItemQuery(Sender: TObject; 106 var Item: TObject); 107 procedure VA508ComponentAccessibility2InstructionsQuery(Sender: TObject; 108 var Text: string); 109 procedure VA508ComponentAccessibility2ComponentNameQuery(Sender: TObject; 110 var Text: string); 111 procedure VA508ComponentAccessibility2CaptionQuery(Sender: TObject; 112 var Text: string); 113 procedure SymptomDateBoxExit(Sender: TObject); 114 procedure SymptomDateBoxDateDialogClosed(Sender: TObject); 115 procedure calObservedDateExit(Sender: TObject); 116 procedure VA508ComponentAccessibility3StateQuery(Sender: TObject; 117 var Text: string); 118 procedure memErrCmtsExit(Sender: TObject); 92 119 private 93 120 FLastAllergyID: string; … … 96 123 FChanged: Boolean; 97 124 FOldHintPause : integer; 125 procedure SetDate; 98 126 protected 99 127 procedure EnableDisableControls(EnabledStatus: boolean); … … 106 134 end; 107 135 108 function EnterEditAllergy(AllergyIEN: integer; AddNew, MarkAsEnteredInError: boolean ): boolean;136 function EnterEditAllergy(AllergyIEN: integer; AddNew, MarkAsEnteredInError: boolean; AnOwner: TComponent = nil; ARefNum: Integer = -1): boolean; 109 137 function MarkEnteredInError(AllergyIEN: integer): boolean; 110 138 function EnterNKAForPatient: boolean; 111 139 112 140 var 141 frmARTAllergy: TfrmARTAllergy; 113 142 AllergyList: TStringList; 114 143 OldRec, NewRec: TAllergyRec; 115 144 Defaults: TStringList; 116 145 Changing: Boolean; 146 FAbort: Boolean; 117 147 uAddingNew: boolean = FALSE; 118 148 uEditing: Boolean = FALSE; … … 126 156 127 157 uses 128 rODBase, uCore, rCore, rCover, f AllgyFind, fPtCWAD, fRptBox;158 rODBase, uCore, rCore, rCover, fCover, fAllgyFind, fPtCWAD, fRptBox, VA508AccessibilityRouter; 129 159 130 160 const … … 183 213 end; 184 214 185 function EnterEditAllergy(AllergyIEN: integer; AddNew, MarkAsEnteredInError: boolean): boolean; 186 var 187 frmARTAllergy: TfrmARTAllergy; 215 function EnterEditAllergy(AllergyIEN: integer; AddNew, MarkAsEnteredInError: boolean; AnOwner: TComponent = nil; ARefNum: Integer = -1): boolean; 216 var 188 217 Allergy: string; 189 begin 218 begin 219 Result := False; 220 if AnOwner = nil then AnOwner := Application; 221 222 if frmARTAllergy <> nil then 223 begin 224 InfoBox('You are already entering/editing an Allergy.', 'Information', MB_OK); 225 exit; 226 end; 190 227 uAddingNew := AddNew; 191 228 uEditing := (not AddNew) and (not MarkAsEnteredInError); 192 229 uEnteredInError := MarkAsEnteredInError; 193 Result := False;194 frmARTAllergy := TfrmARTAllergy.Create(Application);230 frmARTAllergy := TfrmARTAllergy.Create(AnOwner); 231 if ARefNum <> -1 then frmARTAllergy.RefNum := ARefNum; 195 232 if frmARTAllergy.AbortAction then exit; 196 233 with frmARTAllergy do … … 228 265 ckNoKnownAllergies.Checked := True; 229 266 Result := EnterNKAForPatient; 267 frmARTAllergy.Close; 230 268 Exit; 231 269 end … … 253 291 Exit; 254 292 end; 255 ShowModal; 293 294 origlbl508.Caption := 'Originator. Read Only. Value is ' + cboOriginator.SelText; 295 origdtlbl508.Caption := 'Origination Date. Read Only. Value is '+ calOriginated.Text; 296 Show; 256 297 Result := FChanged; 257 298 finally 258 uAddingNew := FALSE;259 uEditing := FALSE;260 uEnteredInError := FALSE;261 uUserCanVerify := FALSE;262 frmARTAllergy.Release;299 // uAddingNew := FALSE; 300 // uEditing := FALSE; 301 // uEnteredInError := FALSE; 302 // uUserCanVerify := FALSE; 303 //frmARTAllergy.Release; 263 304 end; 264 305 end; … … 268 309 inherited; // what to do here? How to set up dialog defaults without order dialog to supply prompts? 269 310 Changing := True; 311 FAbort := True; 270 312 AbortAction := False; 271 313 AllergyList := TStringList.Create; … … 289 331 StatusText('Initializing Long List'); 290 332 ExtractItems(cboSymptoms.Items, Defaults, 'Top Ten'); 291 cboSymptoms.InsertSeparator; 333 if ScreenReaderSystemActive then cboSymptoms.Items.Add('^----Separator for end of Top Ten signs and symptoms------') 334 else cboSymptoms.InsertSeparator; 292 335 cboSymptoms.InitLongList(''); 293 336 cboOriginator.InitLongList(User.Name) ; … … 306 349 var 307 350 Allergy: string; 351 i: Integer; 308 352 //ErrMsg: string; 309 353 begin … … 344 388 ckChartMarked.Checked := ckChartMarked.Checked or uAddingNew; 345 389 ListAllergies(AllergyList); 390 for i:=0 to grpObsHist.ControlCount -1 do 391 TWinControl(grpObsHist.Controls[i]).TabStop := true; 346 392 with AllergyList do 347 393 if Count > 0 then 348 394 begin 349 395 if (Piece(Strings[0], U, 1) = '') and (Piece(Strings[0], U, 2) <> 'No Known Allergies') then 350 ckNoKnownAllergies.Enabled := True 396 begin 397 ckNoKnownAllergies.Enabled := True; 398 //TDP - CQ#19731 make sure NoAllergylbl508 is not enabled or visible if 399 // ckNoKnownAllergies is enabled 400 NoAllergylbl508.Enabled := False; 401 NoAllergylbl508.Visible := False; 402 end 351 403 else 352 404 begin 353 405 ckNoKnownAllergies.Enabled := False; 354 406 btnCurrent.Enabled := True; 407 //TDP - CQ#19731 make sure NoAllergylbl508 is enabled and visible if 408 // ckNoKnownAllergies is disabled 409 if ScreenReaderSystemActive then 410 begin 411 NoAllergylbl508.Enabled := True; 412 NoAllergylbl508.Visible := True; 413 end; 355 414 end; 356 415 end … … 359 418 btnCurrent.Enabled := False; 360 419 ckNoKnownAllergies.Enabled := True; 420 //TDP - CQ#19731 make sure NoAllergylbl508 is not enabled or visible if 421 // ckNoKnownAllergies is enabled 422 NoAllergylbl508.Enabled := False; 423 NoAllergylbl508.Visible := False; 361 424 end; 362 425 if (not uEditing) and (not uEnteredInError) and (not uAddingNew) then … … 387 450 Changing := False; 388 451 ControlChange(lstAllergy); 452 origlbl508.Visible := False; 453 origdtlbl508.Visible := False; 454 if ScreenReaderSystemActive then 455 begin 456 origlbl508.Enabled := True; 457 origdtlbl508.Enabled := True; 458 origlbl508.Visible := True; 459 origdtlbl508.Visible := True; 460 // cboOriginator.Enabled := True; 461 // calOriginated.Enabled := True; 462 // calOriginated.ReadOnly := True; 463 end; 464 end; 465 466 procedure TfrmARTAllergy.SetDate; 467 var 468 x: string; 469 begin 470 Changing := True; 471 with lstSelectedSymptoms do 472 begin 473 if (Items.Count = 0) or (ItemIndex = -1) or (not SymptomDateBox.IsValid) then exit; 474 475 if SymptomDateBox.FMDateTime > FMNow then 476 InfoBox(TX_NO_FUTURE_DATES, TX_CAP_FUTURE, MB_OK) 477 else 478 begin 479 x := Items[ItemIndex]; 480 x := ORFn.Pieces(x, U, 1, 2) + U + FloatToStr(SymptomDateBox.FMDateTime) + U + 481 FormatFMDateTime('mmm dd,yyyy@hh:nn', SymptomDateBox.FMDateTime); 482 Items[ItemIndex] := x; 483 end; 484 end; 485 Changing := False; 486 ControlChange(SymptomDateBox); 389 487 end; 390 488 … … 437 535 Changing := False; 438 536 end; 537 538 end; 539 540 procedure TfrmARTAllergy.VA508ComponentAccessibility1StateQuery(Sender: TObject; 541 var Text: string); 542 begin 543 inherited; 544 Text := 'Comments ' + memComments.Text; 545 end; 546 547 procedure TfrmARTAllergy.VA508ComponentAccessibility2CaptionQuery( 548 Sender: TObject; var Text: string); 549 begin 550 inherited; 551 552 Text := 'Causative Agent'; 553 end; 554 555 procedure TfrmARTAllergy.VA508ComponentAccessibility2ComponentNameQuery( 556 Sender: TObject; var Text: string); 557 begin 558 inherited; 559 560 Text := 'List Box'; 561 end; 562 563 procedure TfrmARTAllergy.VA508ComponentAccessibility2InstructionsQuery( 564 Sender: TObject; var Text: string); 565 begin 566 //inherited; 567 568 Text := 'Read Only'; 569 end; 570 571 procedure TfrmARTAllergy.VA508ComponentAccessibility2ItemInstructionsQuery( 572 Sender: TObject; var Text: string); 573 begin 574 //inherited; 575 Text := ' '; 576 end; 577 578 procedure TfrmARTAllergy.VA508ComponentAccessibility2ItemQuery(Sender: TObject; 579 var Item: TObject); 580 begin 581 inherited; 582 Text := ' '; 583 end; 584 585 procedure TfrmARTAllergy.VA508ComponentAccessibility2StateQuery(Sender: TObject; 586 var Text: string); 587 begin 588 // inherited; 589 Text := ' '; 590 end; 591 592 procedure TfrmARTAllergy.VA508ComponentAccessibility2ValueQuery(Sender: TObject; 593 var Text: string); 594 begin 595 inherited; 596 Text := Piece(lstAllergy.Items[0],U,2); 597 end; 598 599 procedure TfrmARTAllergy.VA508ComponentAccessibility3StateQuery(Sender: TObject; 600 var Text: string); 601 begin 602 inherited; 603 Text := memErrCmts.Text; 439 604 end; 440 605 … … 524 689 end; 525 690 691 procedure TfrmARTAllergy.calObservedDateExit(Sender: TObject); 692 var 693 x: string; 694 begin 695 inherited; 696 calObservedDate.Validate(x); 697 calObservedDate.FMDateTime := calObservedDate.FMDateTime; 698 end; 699 526 700 procedure TfrmARTAllergy.cboOriginatorNeedData(Sender: TObject; 527 701 const StartFrom: string; Direction, InsertAt: Integer); … … 542 716 inherited; 543 717 Changing := True; 544 cboSeverity.ItemIndex := -1;718 cboSeverity.ItemIndex := 1; 545 719 case grpObsHist.ItemIndex of 546 720 0: begin … … 700 874 end; 701 875 702 procedure TfrmARTAllergy.btnAgentClick(Sender: TObject); 876 procedure TfrmARTAllergy.memErrCmtsExit(Sender: TObject); 877 var 878 AStringList: TStringList; 879 begin 880 inherited; 881 AStringList := TStringList.Create; 882 try 883 QuickCopy(memErrCmts, AStringList); 884 LimitStringLength(AStringList, 74); 885 QuickCopy(AstringList, memErrCmts); 886 ControlChange(Self); 887 finally 888 AStringList.Free; 889 end; 890 end; 891 892 procedure TfrmARTAllergy.SymptomDateBoxDateDialogClosed(Sender: TObject); 893 begin 894 inherited; 895 SetDate; 896 end; 897 898 procedure TfrmARTAllergy.SymptomDateBoxExit(Sender: TObject); 899 begin 900 inherited; 901 SetDate; 902 end; 903 904 procedure TfrmARTAllergy.btnAgent1Click(Sender: TObject); 703 905 var 704 906 Allergy: string; … … 756 958 uDeletedSymptoms.Free; 757 959 AllergyList.Free; 960 frmARTAllergy := NIL; 961 962 uAddingNew := FALSE; 963 uEditing := FALSE; 964 uEnteredInError := FALSE; 965 uUserCanVerify := FALSE; 966 frmCover.UpdateAllergiesList; 967 758 968 inherited; 759 969 end; … … 796 1006 lstAllergy.Enabled := EnabledStatus; 797 1007 cboSymptoms.Enabled := EnabledStatus; 798 btnDateTime.Enabled:= EnabledStatus;1008 SymptomDateBox.Enabled := EnabledStatus; 799 1009 end; 800 1010 … … 812 1022 begin 813 1023 FChanged := False; 1024 FAbort := False; 814 1025 Close; 815 1026 Exit; … … 824 1035 Application.ProcessMessages; 825 1036 end; 1037 FAbort := False; 826 1038 Close; 827 1039 end; … … 883 1095 end; 884 1096 885 procedure TfrmARTAllergy.btnDateTimeClick(Sender: TObject);886 var887 AFMDateTime: TFMDateTime;888 x: string;889 begin890 inherited;891 Changing := True;892 with lstSelectedSymptoms do893 begin894 if (Items.Count = 0) or (ItemIndex = -1) then exit;895 AFMDateTime := MakeFMDateTime(Piece(Items[ItemIndex], U, 3));896 if AFMDateTime > 0 then897 dlgReactionDateTime.FMDateTime := AFMDateTime898 else899 dlgReactionDateTime.FMDateTime := FMNow;900 if not dlgReactionDateTime.Execute then exit;901 if dlgReactionDateTime.FMDateTime > FMNow then902 InfoBox(TX_NO_FUTURE_DATES, TX_CAP_FUTURE, MB_OK)903 else904 begin905 x := Items[ItemIndex];906 x := ORFn.Pieces(x, U, 1, 2) + U + FloatToStr(dlgReactionDateTime.FMDateTime) + U +907 FormatFMDateTime('mmm dd,yyyy@hh:nn', dlgReactionDateTime.FMDateTime);908 Items[ItemIndex] := x;909 end;910 end;911 Changing := False;912 ControlChange(btnDateTime);913 end;914 915 1097 procedure TfrmARTAllergy.cboSymptomsMouseClick(Sender: TObject); 916 1098 const … … 984 1166 985 1167 procedure TfrmARTAllergy.lstSelectedSymptomsChange(Sender: TObject); 1168 var 1169 AFMDateTime: TFMDateTime; 986 1170 begin 987 1171 inherited; 988 1172 with lstSelectedSymptoms do 989 1173 begin 990 btnDateTime.Enabled := (ItemIndex <> -1); 991 btnRemove.Enabled := btnDateTime.Enabled; 992 end; 993 //ControlChange(Self); 1174 SymptomDateBox.Enabled := (ItemIndex <> -1); 1175 btnRemove.Enabled := (ItemIndex <> -1); 1176 1177 if SymptomDateBox.Enabled then begin 1178 AFMDateTime := MakeFMDateTime(Piece(Items[ItemIndex], U, 3)); 1179 if AFMDateTime > 0 then 1180 SymptomDateBox.FMDateTime := AFMDateTime 1181 end; 1182 end; 994 1183 end; 995 1184 … … 1083 1272 begin 1084 1273 inherited; 1274 Release; 1085 1275 uEditing := False; 1086 1276 uEnteredInError := False; … … 1088 1278 Application.HintHidePause := FOldHintPause; 1089 1279 Action := caFree; 1280 1090 1281 end; 1091 1282 … … 1094 1285 begin 1095 1286 inherited; 1287 if FAbort and frmARTAllergy.Visible then 1288 begin 1289 if InfoBox('Are you sure you want to cancel Entering/Editing this allergy?', 'Exiting Allergy Enter/Edit form', MB_YESNO) = ID_NO then 1290 begin 1291 CanClose := false; 1292 exit; 1293 end; 1294 end; 1096 1295 if AbortAction then exit; 1097 1296 end;
Note:
See TracChangeset
for help on using the changeset viewer.