Changeset 830 for cprs/trunk/CPRS-Chart/uReminders.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/uReminders.pas
r456 r830 6 6 Windows, Messages, Classes, Controls, StdCtrls, SysUtils, ComCtrls, Menus, 7 7 Graphics, Forms, ORClasses, ORCtrls, ORDtTm, ORFn, ORNet, Dialogs, uPCE, uVitals, 8 ExtCtrls, fDrawers, fDeviceSelect ;8 ExtCtrls, fDrawers, fDeviceSelect, TypInfo; 9 9 10 10 type … … 21 21 FWHReviewIEN: string; // AGP CHANGE 23.13 Allow for multiple processing of WH Review of Result Reminders 22 22 FRemWipe: integer; 23 FMHTestArray: TORStringList; 23 24 protected 24 25 function GetIEN: string; virtual; … … 41 42 function Processing: boolean; 42 43 procedure AddText(Lst: TStrings); 44 procedure ClearMHTest(RIEN: String); 43 45 property PrintName: string read GetPrintName; 44 46 property IEN: string read GetIEN; … … 50 52 property WHReviewIEN: string read FWHReviewIEN write FWHReviewIEN; //AGP CHANGE 23.13 51 53 property RemWipe: integer read FRemWipe write FRemWipe; 54 property MHTestArray: TORStringList read FMHTestArray write FMHTestArray; 52 55 end; 53 56 … … 73 76 end; 74 77 75 TRDChildReq = (crNone, crOne, crAtLeastOne, crNoneOrOne );78 TRDChildReq = (crNone, crOne, crAtLeastOne, crNoneOrOne, crAll); 76 79 TRDElemType = (etCheckBox, etTaxonomy, etDisplayOnly); 77 80 … … 112 115 function TrueIndent: integer; 113 116 procedure cbClicked(Sender: TObject); 117 procedure cbEntered(Sender: TObject); 114 118 procedure FieldPanelEntered(Sender: TObject); 115 119 procedure FieldPanelExited(Sender: TObject); … … 137 141 function FindingType: string; 138 142 function Historical: boolean; 139 function ResultDlgID: integer;143 function ResultDlgID: string; 140 144 function IncludeMHTestInPN: boolean; 141 145 function HideChildren: boolean; … … 339 343 procedure ClearReminderData; 340 344 function GetReminder(ARemData: string): TReminder; 341 procedure WordWrap( constAText: string; Output: TStrings; LineLength: integer;342 AutoIndent: integer = 4 );345 procedure WordWrap(AText: string; Output: TStrings; LineLength: integer; 346 AutoIndent: integer = 4; MHTest: boolean = false); 343 347 function InteractiveRemindersActive: boolean; 344 348 function GetReminderData(Rem: TReminderDialog; Lst: TStrings; Finishing: boolean = FALSE; … … 352 356 //const 353 357 // InteractiveRemindersActive = FALSE; 354 type355 TWHCheckBox = class(TORCheckBox)356 private357 FPrintNow: TORCheckBox;358 FViewLetter: TORCheckBox;359 FCheck1: TORCheckBox;360 FCheck2: TORCheckBox;361 FCheck3: TORCheckBox;362 FEdit: TEdit;363 FButton: TButton;364 FOnDestroy: TNotifyEvent;365 Flbl, Flbl2: TLabel;366 FPrintVis: String;367 //FPrintDevice: String;368 FPntNow: String;369 FPntBatch: String;370 FButtonText: String;371 FCheckNum: String;372 protected373 public374 property lbl: TLabel read Flbl write Flbl;375 property lbl2: TLabel read Flbl2 write Flbl2;376 property PntNow: String read FPntNow write FPntNow;377 property PntBatch: String read FPntBatch write FPntBatch;378 property CheckNum: String read FCheckNum write FCheckNum;379 property ButtonText: String read FButtonText write FButtonText;380 property PrintNow: TORCheckBox read FPrintNow write FPrintNow;381 property Check1: TORCheckBox read FCheck1 write FCheck1;382 property Check2: TORCheckBox read FCheck2 write FCheck2;383 property Check3: TORCheckBox read FCheck3 write FCheck3;384 property ViewLetter: TORCheckBox read FViewLetter write FViewLetter;385 property Button: TButton read FButton write FButton;386 property Edit: TEdit read FEdit write FEdit;387 property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;388 property PrintVis: String read FPrintVis write FPrintVis;389 end;390 358 391 359 var … … 435 403 436 404 uses rCore, uCore, rReminders, fRptBox, uConst, fReminderDialog, fNotes, rMisc, 437 fMHTest, rPCE, rTemplates, dShared, uTemplateFields, fIconLegend, fReminderTree, uInit; 405 fMHTest, rPCE, rTemplates, dShared, uTemplateFields, fIconLegend, fReminderTree, uInit, 406 VAUtils, VA508AccessibilityRouter, VA508AccessibilityManager, uDlgComponents, 407 fBase508Form; 438 408 439 409 type … … 441 411 TRemFolders = set of TRemFolder; 442 412 TValidRemFolders = succ(low(TRemFolder)) .. high(TRemFolder); 413 TExposedComponent = class(TControl); 414 415 TWHCheckBox = class(TCPRSDialogCheckBox) 416 private 417 FPrintNow: TCPRSDialogCheckBox; 418 FViewLetter: TCPRSDialogCheckBox; 419 FCheck1: TWHCheckBox; 420 FCheck2: TWHCheckBox; 421 FCheck3: TWHCheckBox; 422 FEdit: TEdit; 423 FButton: TButton; 424 FOnDestroy: TNotifyEvent; 425 Flbl, Flbl2: TControl; 426 FPrintVis: String; 427 //FPrintDevice: String; 428 FPntNow: String; 429 FPntBatch: String; 430 FButtonText: String; 431 FCheckNum: String; 432 protected 433 public 434 property lbl: TControl read Flbl write Flbl; 435 property lbl2: TControl read Flbl2 write Flbl2; 436 property PntNow: String read FPntNow write FPntNow; 437 property PntBatch: String read FPntBatch write FPntBatch; 438 property CheckNum: String read FCheckNum write FCheckNum; 439 property ButtonText: String read FButtonText write FButtonText; 440 property PrintNow: TCPRSDialogCheckBox read FPrintNow write FPrintNow; 441 property Check1: TWHCheckBox read FCheck1 write FCheck1; 442 property Check2: TWHCheckBox read FCheck2 write FCheck2; 443 property Check3: TWHCheckBox read FCheck3 write FCheck3; 444 property ViewLetter: TCPRSDialogCheckBox read FViewLetter write FViewLetter; 445 property Button: TButton read FButton write FButton; 446 property Edit: TEdit read FEdit write FEdit; 447 property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; 448 property PrintVis: String read FPrintVis write FPrintVis; 449 end; 443 450 444 451 var … … 459 466 HistRootCount: longint = 0; 460 467 uRemFolders: TRemFolders = [rfUnknown]; 461 468 462 469 const 463 470 DueText = 'Due'; … … 605 612 ptReaction, ptContraindicated, ptLevelUnderstanding]; 606 613 607 Gap = 2;614 Gap = 3; 608 615 LblGap = 4; 609 616 IndentGap = 18; … … 631 638 MonthReqCode = 'M'; 632 639 633 type634 TVitalComboBox = class;635 636 TVitalEdit = class(TEdit)637 private638 FLinkedCombo: TVitalComboBox;639 end;640 641 TVitalComboBox = class(TComboBox)642 private643 FLinkedEdit: TVitalEdit;644 public645 procedure SelectByID(Value: string);646 end;647 648 640 function InitText(const InStr: string): string; 649 641 var … … 690 682 end; 691 683 692 693 procedure TVitalComboBox.SelectByID(Value: string);694 var695 i: integer;696 697 begin698 for i := 0 to Items.Count-1 do699 if(Value = Items[i]) then700 begin701 ItemIndex := i;702 break;703 end;704 end;705 706 684 type 707 685 TMultiClassObj = record 708 686 case integer of 709 0: (edt: T Edit);710 1: (cb: T ORCheckBox);711 2: (cbo: T ORComboBox);712 3: (dt: T ORDateCombo);687 0: (edt: TCPRSDialogFieldEdit); 688 1: (cb: TCPRSDialogCheckBox); 689 2: (cbo: TCPRSDialogComboBox); 690 3: (dt: TCPRSDialogDateCombo); 713 691 4: (ctrl: TORExposedControl); 714 692 5: (vedt: TVitalEdit); 715 693 6: (vcbo: TVitalComboBox); 716 7: (btn: T Button);694 7: (btn: TCPRSDialogButton); 717 695 8: (pNow: TORCheckBox); 718 696 9: (pBat: TORCheckBox); … … 757 735 TmpSL := TStringList.Create; 758 736 try 759 TmpSL.Assign(RemindersInProcess);737 FastAssign(RemindersInProcess, TmpSL); 760 738 TmpSL.Sort; 761 739 for i := 0 to TmpSL.Count-1 do … … 808 786 OtherReminders.Notifier.BeginUpdate; 809 787 TmpActive := TStringList.Create; 810 TmpActive.Assign(ActiveReminders);788 FastAssign(ActiveReminders, TmpActive); 811 789 TmpOther := TStringList.Create; 812 TmpOther.Assign(OtherReminders);790 FastAssign(OtherReminders, TmpOther); 813 791 end; 814 792 … … 1003 981 begin 1004 982 EvaluateReminders(RemList); 1005 RemList.Assign(RPCBrokerV.Results);983 FastAssign(RPCBrokerV.Results, RemList); 1006 984 for i := 0 to RemList.Count-1 do 1007 985 ReminderEvaluated(RemList[i], (i = (RemList.Count-1))); … … 1050 1028 end; 1051 1029 end; 1052 // ActiveReminders.Assign(TempList);1030 // FastAssign(TempList,ActiveReminders); 1053 1031 for i := 0 to TempList.Count-1 do 1054 1032 begin … … 2094 2072 ScootOver: integer = 0; 2095 2073 2096 procedure WordWrap(const AText: string; Output: TStrings; LineLength: integer; 2097 AutoIndent: integer = 4); 2098 var 2099 i, l, max, FCount: integer; 2100 First: boolean; 2101 OrgText, Text, Prefix: string; 2102 2103 begin 2074 procedure WordWrap(AText: string; Output: TStrings; LineLength: integer; 2075 AutoIndent: integer = 4; MHTest: boolean = false); 2076 var 2077 i, j, l, max, FCount, MHLoop: integer; 2078 First, MHRes: boolean; 2079 OrgText, Text, Prefix, tmpText: string; 2080 2081 begin 2082 StripScreenReaderCodes(AText); 2104 2083 inc(LineLength, ScootOver); 2105 2084 dec(AutoIndent, ScootOver); 2106 2085 FCount := Output.Count; 2107 2086 First := TRUE; 2108 OrgText := InitText(AText); 2087 MHLoop := 1; 2088 MHRes := False; 2089 tmpText := ''; 2090 if Pos('~', AText)>0 then MHLoop := 2; 2091 for j := 1 to MHLoop do 2092 begin 2093 if (j = 1) and (MHLoop = 2) then 2094 begin 2095 tmpText := Piece(AText, '~', 1); 2096 MHRes := True; 2097 end 2098 else if (j = 2) then 2099 begin 2100 tmpText := Piece(AText, '~', 2); 2101 First := False; 2102 MHRes := False; 2103 end 2104 else if (j = 1) and (MHLoop = 1) then 2105 begin 2106 tmpText := AText; 2107 First := False; 2108 MHRes := False; 2109 end; 2110 if tmpText <> '' then OrgText := tmpText 2111 else OrgText := InitText(AText); 2109 2112 Prefix := StringOfChar(' ',74-LineLength); 2110 2113 repeat … … 2156 2159 end; 2157 2160 end; 2158 if (First) and (FCount <> Output.Count) then2161 if ((First) and (FCount <> Output.Count)) and (MHRes = False) then 2159 2162 begin 2160 2163 dec(LineLength, AutoIndent); … … 2163 2166 end; 2164 2167 until(OrgText = ''); 2168 end; 2165 2169 end; 2166 2170 … … 2554 2558 if(Result.Count = 0) then 2555 2559 begin 2556 Result.Assign(GetDialogInfo(GetIEN, (Self is TReminder)));2560 FastAssign(GetDialogInfo(GetIEN, (Self is TReminder)), Result); 2557 2561 Result.Add(DlgCalled); // Used to prevent repeated calling of RPC if dialog is empty 2558 2562 end; … … 2583 2587 if(AParent.ControlCount = 0) then 2584 2588 begin 2585 with T Label.Create(AOwner) do2589 with TVA508StaticText.Create(AOwner) do 2586 2590 begin 2587 2591 Parent := AParent; … … 2598 2602 i, idx: integer; 2599 2603 Elem: TRemDlgElement; 2604 temp: string; 2600 2605 2601 2606 begin … … 2610 2615 end; 2611 2616 if (Self is TReminder) and (PrintName <> '') and (idx <> Lst.Count) then 2612 Lst.Insert(idx, ' ' + PrintName + ':') 2617 begin 2618 temp := PrintName; 2619 StripScreenReaderCodes(temp); 2620 Lst.Insert(idx, ' ' + temp + ':') 2621 end; 2613 2622 end; 2614 2623 end; … … 2631 2640 end; 2632 2641 end; 2642 end; 2643 2644 procedure TReminderDialog.ClearMHTest(RIEN: String); 2645 var 2646 i,j: integer; 2647 TestName: string; 2648 begin 2649 if (self.MHTestArray <> nil) and (self.MHTestArray.Count > 0) then 2650 begin 2651 i := self.MHTestArray.IndexOfPiece(RIEN, U, 2, -1); 2652 while i > -1 do 2653 begin 2654 TestName := Piece(self.MHTestArray.Strings[i], U, 1); 2655 self.MHTestArray.Delete(i); 2656 j := self.MHTestArray.IndexOfPiece(TestName, U, 1, -1); 2657 if j = -1 then RemoveMHTest(TestName); 2658 i := self.MHTestArray.IndexOfPiece(RIEN, U, 2, -1); 2659 end; 2660 end; 2633 2661 end; 2634 2662 … … 2909 2937 else if Tmp = '2' then Result := crAtLeastOne 2910 2938 else if Tmp = '3' then Result := crNoneOrOne 2939 else if Tmp = '4' then result := crAll 2911 2940 else Result := crNone; 2912 2941 end; … … 2979 3008 TempSL[i] := Tmp; 2980 3009 end; 2981 F Reminder.GetDlgSL.AddStrings(TempSL);3010 FastAddStrings(TempSL, FReminder.GetDlgSL); 2982 3011 end; 2983 3012 UpdateData; … … 3160 3189 U + 'P' + U + Tmp + U + BOOLCHAR[NewLine] + U + '0'; 3161 3190 FData := RData; 3162 if (Piece(FRec3, U, r3GAF) = '1') then3191 if ((Piece(FRec3, U, r3GAF) = '1')) and (MHDLLFound = false) then 3163 3192 begin 3164 3193 FOverrideType := ptGAF; … … 3352 3381 end; 3353 3382 RemindersInProcess.Notifier.Notify; 3354 TFieldPanel(TORCheckBox(Sender).Associate).SetFocus; 3383 if assigned(TORCheckBox(Sender).Associate) and (not ScreenReaderSystemActive) then 3384 TDlgFieldPanel(TORCheckBox(Sender).Associate).SetFocus; 3355 3385 end; 3356 3386 … … 3395 3425 Result := FALSE; 3396 3426 end; 3397 3427 3428 type 3429 TAccessCheckBox = class(TORCheckBox); 3430 3431 procedure TRemDlgElement.cbEntered(Sender: TObject); 3432 begin 3433 // changing focus because of a mouse click sets ClicksDisabled to false during the 3434 // call to SetFocus - this is how we allow the cbClicked code to execute on a mouse 3435 // click, which will set the focus after the mouse click. All other cases and the 3436 // ClicksDisabled will be FALSE and the focus is reset here. If we don't make this 3437 // check, you can't click on the check box.. 3438 if (Last508KeyCode = VK_UP) or (Last508KeyCode = VK_LEFT) then 3439 begin 3440 UnfocusableControlEnter(nil, Sender); 3441 exit; 3442 end; 3443 if not TAccessCheckBox(Sender).ClicksDisabled then 3444 begin 3445 if ScreenReaderSystemActive then 3446 (Sender as TCPRSDialogParentCheckBox).FocusOnBox := true 3447 else 3448 TDlgFieldPanel(TORCheckBox(Sender).Associate).SetFocus; 3449 end; 3450 end; 3451 3398 3452 procedure TRemDlgElement.ParentCBEnter(Sender: TObject); 3399 3453 begin 3400 (Sender as TORCheck box).FocusOnBox := true;3454 (Sender as TORCheckBox).FocusOnBox := true; 3401 3455 end; 3402 3456 3403 3457 procedure TRemDlgElement.ParentCBExit(Sender: TObject); 3404 3458 begin 3405 (Sender as TORCheckbox).FocusOnBox := false; 3406 end; 3407 3459 (Sender as TORCheckBox).FocusOnBox := false; 3460 end; 3461 3462 type 3463 TORExposedWinControl = class(TWinControl); 3408 3464 3409 3465 function TRemDlgElement.BuildControls(var Y: integer; ParentWidth: integer; … … 3411 3467 var 3412 3468 lbl: TLabel; 3413 pnl: TPanel; 3469 lblText: string; 3470 sLbl: TCPRSDialogStaticLabel; 3471 lblCtrl: TControl; 3472 pnl: TDlgFieldPanel; 3414 3473 AutoFocusControl: TWinControl; 3415 cb: T ORCheckBox;3474 cb: TCPRSDialogParentCheckBox; 3416 3475 gb: TGroupBox; 3417 3476 ERes, prnt: TWinControl; … … 3430 3489 vt: TVitalType; 3431 3490 DefaultDate: TFMDateTime; 3432 3433 function GetPanel(const EID, AText: string; const PnlWidth: integer): TPanel; 3491 Req: boolean; 3492 3493 function GetPanel(const EID, AText: string; const PnlWidth: integer; 3494 OwningCheckBox: TCPRSDialogParentCheckBox): TDlgFieldPanel; 3434 3495 var 3435 3496 idx, p: integer; … … 3460 3521 // values to the values that were restored to the Entry from the Element if 3461 3522 // they exist, otherwise the default values will remain. 3462 Result := Entry.GetPanel(PnlWidth, BaseParent );3523 Result := Entry.GetPanel(PnlWidth, BaseParent, OwningCheckBox); 3463 3524 end; 3464 3525 … … 3488 3549 cb.Top := pnl.Top; 3489 3550 SameLineCtrl.Clear; 3551 end; 3552 3553 procedure ProcessLabel(Required, AEnabled: boolean; 3554 AParent: TWinControl; Control: TControl); begin 3555 if(Trim(Prompt.Caption) = '') and (not Required) then 3556 lblCtrl := nil 3557 else 3558 begin 3559 lbl := TLabel.Create(AOwner); 3560 lbl.Parent := AParent; 3561 if ScreenReaderSystemActive then 3562 begin 3563 sLbl := TCPRSDialogStaticLabel.Create(AOwner); 3564 sLbl.Parent := AParent; 3565 sLbl.Height := lbl.Height; 3566 // get groop box hearder, if any 3567 // (sLbl as ICPRSDialogComponent).BeforeText := ScreenReaderSystem_GetPendingText; 3568 lbl.Free; 3569 lblCtrl := sLbl; 3570 end 3571 else 3572 lblCtrl := lbl; 3573 lblText := Prompt.Caption; 3574 if Required then 3575 begin 3576 if assigned(Control) and Supports(Control, ICPRSDialogComponent) then 3577 begin 3578 (Control as ICPRSDialogComponent).RequiredField := TRUE; 3579 if ScreenReaderSystemActive and (AOwner = frmRemDlg) then 3580 frmRemDlg.amgrMain.AccessText[sLbl] := lblText; 3581 end; 3582 lblText := lblText + ' *'; 3583 end; 3584 SetStrProp(lblCtrl, CaptionProperty, lblText); 3585 if ScreenReaderSystemActive then 3586 begin 3587 ScreenReaderSystem_CurrentLabel(sLbl); 3588 ScreenReaderSystem_AddText(lblText); 3589 end; 3590 lblCtrl.Enabled := AEnabled; 3591 UpdateColorsFor508Compliance(lblCtrl); 3592 end; 3593 end; 3594 3595 procedure ScreenReaderSupport(Control: TWinControl); 3596 begin 3597 if ScreenReaderSystemActive then 3598 begin 3599 if Supports(Control, ICPRSDialogComponent) then 3600 ScreenReaderSystem_CurrentComponent(Control as ICPRSDialogComponent) 3601 else 3602 ScreenReaderSystem_Stop; 3603 end; 3490 3604 end; 3491 3605 … … 3552 3666 MaxX := 0; 3553 3667 lbl := nil; 3668 sLbl := nil; 3669 lblCtrl := nil; 3554 3670 DoLbl := Prompt.Required; 3555 3671 case pt of 3556 3672 ptComment, ptQuantity: 3557 3673 begin 3558 Ctrl.edt := T Edit.Create(AOwner);3674 Ctrl.edt := TCPRSDialogFieldEdit.Create(AOwner); 3559 3675 Ctrl.ctrl.Parent := AParent; 3560 3676 Ctrl.edt.Text := Prompt.Value; … … 3582 3698 MinX := TextWidthByFont(Ctrl.edt.Font.Handle, IntToStr(ud.Max)) + 24; 3583 3699 ud.Position := StrToIntDef(Prompt.Value, ud.Min); 3700 UpdateColorsFor508Compliance(ud); 3584 3701 end; 3585 3702 Ctrl.edt.OnKeyPress := Prompt.EditKeyPress; 3586 3703 Ctrl.edt.OnChange := Prompt.PromptChange; 3704 UpdateColorsFor508Compliance(Ctrl.edt); 3587 3705 DoLbl := TRUE; 3588 3706 end; … … 3592 3710 ptLevelSeverity, ptSkinResults, ptSkinReading: 3593 3711 begin 3594 Ctrl.cbo := T ORComboBox.Create(AOwner);3712 Ctrl.cbo := TCPRSDialogComboBox.Create(AOwner); 3595 3713 Ctrl.ctrl.Parent := AParent; 3596 3714 Ctrl.cbo.OnKeyDown := Prompt.ComboBoxKeyDown; … … 3666 3784 DoLbl := TRUE; 3667 3785 Ctrl.cbo.ListItemsOnly := (pt <> ptVisitLocation); 3786 UpdateColorsFor508Compliance(Ctrl.cbo); 3668 3787 end; 3669 3788 3670 3789 ptWHPapResult: 3671 3790 begin 3672 if FData<>nil then3791 if FData<>nil then 3673 3792 begin 3674 if (TRemData(FData[i]).DisplayWHResults)=true then 3675 begin 3676 NextLine(Y); 3677 Ctrl.btn := TButton.Create(AOwner); 3678 Ctrl.ctrl.Parent := AParent; 3679 Ctrl.btn.Left := NewLInePromptGap+15; 3680 Ctrl.btn.Top := Y+7; 3681 Ctrl.btn.OnClick := Prompt.DoWHReport; 3682 Ctrl.btn.Caption := 'Review complete report'; 3683 Ctrl.btn.Width := TextWidthByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 13; 3684 Ctrl.btn.Height := TextHeightByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 13; 3685 Ctrl.btn.Height := TextHeightByFont(Ctrl.btn.Handle, Ctrl.btn.Caption) + 8; 3686 Y := ctrl.btn.Top + Ctrl.btn.Height; 3793 if (TRemData(FData[i]).DisplayWHResults)=true then 3794 begin 3795 NextLine(Y); 3796 Ctrl.btn := TCPRSDialogButton.Create(AOwner); 3797 Ctrl.ctrl.Parent := AParent; 3798 Ctrl.btn.Left := NewLInePromptGap+15; 3799 Ctrl.btn.Top := Y+7; 3800 Ctrl.btn.OnClick := Prompt.DoWHReport; 3801 Ctrl.btn.Caption := 'Review complete report'; 3802 Ctrl.btn.Width := TextWidthByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 13; 3803 Ctrl.btn.Height := TextHeightByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 13; 3804 Ctrl.btn.Height := TextHeightByFont(Ctrl.btn.Handle, Ctrl.btn.Caption) + 8; 3805 ScreenReaderSupport(Ctrl.btn); 3806 UpdateColorsFor508Compliance(Ctrl.btn); 3807 Y := ctrl.btn.Top + Ctrl.btn.Height; 3808 NextLine(Y); 3809 Ctrl.WHChk := TWHCheckBox.Create(AOwner); 3810 Ctrl.ctrl.Parent := AParent; 3811 ProcessLabel(Prompt.Required, TRUE, Ctrl.WHChk.Parent, Ctrl.WHChk); 3812 if lblCtrl is TWinControl then 3813 TWinControl(lblCtrl).TabOrder := Ctrl.WHChk.TabOrder; 3814 Ctrl.WHChk.Flbl := lblCtrl; 3815 Ctrl.WHChk.Flbl.Top := Y + 5; 3816 Ctrl.WHChk.Flbl.Left := NewLinePromptGap+15; 3817 WrapLeft := Ctrl.WHChk.Flbl.Left; 3818 // Ctrl.WHChk.Flbl.Width := TextWidthByFont( 3819 // TExposedComponent(Ctrl.WHChk.Flbl).Font.Handle, 3820 // TExposedComponent(Ctrl.WHChk.Flbl).Caption)+25; 3821 // Ctrl.WHChk.Flbl.Height := TextHeightByFont( 3822 // TExposedComponent(Ctrl.WHChk.Flbl).Font.Handle, 3823 // TExposedComponent(Ctrl.WHChk.Flbl).Caption); 3824 //LineWidth := WrapLeft + Ctrl.WHChk.Flbl.Width+10; 3825 Y := Ctrl.WHChk.Flbl.Top + Ctrl.WHChk.Flbl.Height; 3826 NextLine(Y); 3827 Ctrl.WHChk.RadioStyle:=true; 3828 Ctrl.WHChk.GroupIndex:=1; 3829 Ctrl.WHChk.Check2 := TWHCheckBox.Create(AOwner); 3830 Ctrl.WHChk.Check2.Parent := Ctrl.WHChk.Parent; 3831 Ctrl.WHChk.Check2.RadioStyle:=true; 3832 Ctrl.WHChk.Check2.GroupIndex:=1; 3833 Ctrl.WHChk.Check3 := TWHCheckBox.Create(AOwner); 3834 Ctrl.WHChk.Check3.Parent := Ctrl.WHChk.Parent; 3835 Ctrl.WHChk.Check3.RadioStyle:=true; 3836 Ctrl.WHChk.Check3.GroupIndex:=1; 3837 Ctrl.WHChk.Caption := 'NEM (No Evidence of Malignancy)'; 3838 Ctrl.WHChk.ShowHint := true; 3839 Ctrl.WHChk.Hint := 'No Evidence of Malignancy'; 3840 Ctrl.WHChk.Width := TextWidthByFont(Ctrl.WHChk.Font.Handle, Ctrl.WHChk.Caption)+20; 3841 Ctrl.WHChk.Height := TextHeightByFont(Ctrl.WHChk.Font.Handle, Ctrl.WHChk.Caption)+4; 3842 Ctrl.WHChk.Top := Y + 5; 3843 Ctrl.WHChk.Left := WrapLeft; 3844 Ctrl.WHChk.OnClick := Prompt.PromptChange; 3845 Ctrl.WHChk.Checked := (WHResultChk = 'N'); 3846 LineWidth := WrapLeft + Ctrl.WHChk.Width+5; 3847 Ctrl.WHChk.Check2.Caption := 'Abnormal'; 3848 Ctrl.WHChk.Check2.Width := TextWidthByFont(Ctrl.WHChk.Check2.Font.Handle, Ctrl.WHChk.Check2.Caption) + 20; 3849 Ctrl.WHChk.Check2.Height := TextHeightByFont(Ctrl.WHChk.check2.Font.Handle, Ctrl.WHChk.check2.Caption)+4; 3850 if (LineWidth + Ctrl.WHChk.Check2.Width) > PWidth - 10 then 3851 begin 3852 LineWidth := WrapLeft; 3853 Y := Ctrl.WHChk.Top + Ctrl.WHChk.Height; 3854 Nextline(Y); 3855 end; 3856 Ctrl.WHChk.Check2.Top := Y + 5; 3857 Ctrl.WHChk.Check2.Left := LineWidth; 3858 Ctrl.WHChk.Check2.OnClick := Prompt.PromptChange; 3859 Ctrl.WHChk.Check2.Checked := (WHResultChk = 'A'); 3860 LineWidth := LineWidth + Ctrl.WHChk.Check2.Width+5; 3861 Ctrl.WHChk.Check3.Caption := 'Unsatisfactory for Diagnosis'; 3862 Ctrl.WHChk.Check3.Width := TextWidthByFont(Ctrl.WHChk.Check3.Font.Handle, Ctrl.WHChk.Check3.Caption)+20; 3863 Ctrl.WHChk.Check3.Height := TextHeightByFont(Ctrl.WHChk.check3.Font.Handle, Ctrl.WHChk.check3.Caption)+4; 3864 if (LineWidth + Ctrl.WHChk.Check3.Width) > PWidth - 10 then 3865 begin 3866 LineWidth := WrapLeft; 3867 Y := Ctrl.WHChk.Check2.Top + Ctrl.WHChk.Check2.Height; 3868 Nextline(Y); 3869 end; 3870 Ctrl.WHChk.Check3.Top := Y + 5; 3871 Ctrl.WHChk.Check3.OnClick := Prompt.PromptChange; 3872 Ctrl.WHChk.Check3.Checked := (WHResultChk = 'U'); 3873 Ctrl.WHChk.Check3.Left := LineWidth; 3874 UpdateColorsFor508Compliance(Ctrl.WHChk); 3875 UpdateColorsFor508Compliance(Ctrl.WHChk.Flbl); 3876 UpdateColorsFor508Compliance(Ctrl.WHChk.Check2); 3877 UpdateColorsFor508Compliance(Ctrl.WHChk.Check3); 3878 ScreenReaderSupport(Ctrl.WHChk); 3879 ScreenReaderSupport(Ctrl.WHChk.Check2); 3880 ScreenReaderSupport(Ctrl.WHChk.Check3); 3881 Y := Ctrl.WHChk.Check3.Top + Ctrl.WHChk.Check3.Height; 3882 Nextline(Y); 3883 end 3884 else 3885 DoLbl := FALSE; 3886 end 3887 else 3888 DoLbl :=FALSE; 3889 end; 3890 3891 ptWHNotPurp: 3892 begin 3687 3893 NextLine(Y); 3688 3894 Ctrl.WHChk := TWHCheckBox.Create(AOwner); 3689 3895 Ctrl.ctrl.Parent := AParent; 3690 Ctrl.WHChk.Flbl := TLabel.Create(AOwner); 3691 Ctrl.WHChk.Flbl.Parent := Ctrl.WHChk.Parent; 3692 Ctrl.WHChk.Flbl.Caption := Prompt.Caption; 3693 Ctrl.WHChk.Flbl.Top := Y + 5; 3694 Ctrl.WHChk.Flbl.Left := NewLInePromptGap+15; 3695 WrapLeft := Ctrl.WHChk.Flbl.Left; 3696 Ctrl.WHChk.Flbl.Width := TextWidthByFont(Ctrl.WHChk.Flbl.Font.Handle, Ctrl.WHChk.Flbl.Caption)+25; 3697 Ctrl.WHChk.Flbl.Height := TextHeightByFont(Ctrl.WHChk.Flbl.Font.Handle, Ctrl.WHChk.Flbl.Caption); 3698 //LineWidth := WrapLeft + Ctrl.WHChk.Flbl.Width+10; 3699 if Prompt.Required then 3700 Ctrl.WHChk.Flbl.Caption := '* '+Ctrl.WHChk.Flbl.Caption; 3701 Y := Ctrl.WHChk.Flbl.Top + Ctrl.WHChk.Flbl.Height; 3702 NextLine(Y); 3703 Ctrl.WHChk.RadioStyle:=true; 3704 Ctrl.WHChk.GroupIndex:=1; 3705 Ctrl.WHChk.Check2 := TWHCheckBox.Create(AOwner); 3706 Ctrl.WHChk.Check2.Parent := Ctrl.WHChk.Parent; 3707 Ctrl.WHChk.Check2.RadioStyle:=true; 3708 Ctrl.WHChk.Check2.GroupIndex:=1; 3709 Ctrl.WHChk.Check3 := TWHCheckBox.Create(AOwner); 3710 Ctrl.WHChk.Check3.Parent := Ctrl.WHChk.Parent; 3711 Ctrl.WHChk.Check3.RadioStyle:=true; 3712 Ctrl.WHChk.Check3.GroupIndex:=1; 3713 Ctrl.WHChk.Caption := 'NEM (No Evidence of Malignancy)'; 3714 Ctrl.WHChk.ShowHint := true; 3715 Ctrl.WHChk.Hint := 'No Evidence of Malignancy'; 3716 Ctrl.WHChk.Width := TextWidthByFont(Ctrl.WHChk.Font.Handle, Ctrl.WHChk.Caption)+20; 3717 Ctrl.WHChk.Height := TextHeightByFont(Ctrl.WHChk.Font.Handle, Ctrl.WHChk.Caption)+4; 3718 Ctrl.WHChk.Top := Y + 5; 3719 Ctrl.WHChk.Left := WrapLeft; 3720 Ctrl.WHChk.OnClick := Prompt.PromptChange; 3721 Ctrl.WHChk.Checked := (WHResultChk = 'N'); 3722 LineWidth := WrapLeft + Ctrl.WHChk.Width+5; 3723 Ctrl.WHChk.Check2.Caption := 'Abnormal'; 3724 Ctrl.WHChk.Check2.Width := TextWidthByFont(Ctrl.WHChk.Check2.Font.Handle, Ctrl.WHChk.Check2.Caption) + 20; 3725 Ctrl.WHChk.Check2.Height := TextHeightByFont(Ctrl.WHChk.check2.Font.Handle, Ctrl.WHChk.check2.Caption)+4; 3726 if (LineWidth + Ctrl.WHChk.Check2.Width) > PWidth - 10 then 3727 begin 3728 LineWidth := WrapLeft; 3729 Y := Ctrl.WHChk.Top + Ctrl.WHChk.Height; 3730 Nextline(Y); 3731 end; 3732 Ctrl.WHChk.Check2.Top := Y + 5; 3733 Ctrl.WHChk.Check2.Left := LineWidth; 3734 Ctrl.WHChk.Check2.OnClick := Prompt.PromptChange; 3735 Ctrl.WHChk.Check2.Checked := (WHResultChk = 'A'); 3736 LineWidth := LineWidth + Ctrl.WHChk.Check2.Width+5; 3737 Ctrl.WHChk.Check3.Caption := 'Unsatisfactory for Diagnosis'; 3738 Ctrl.WHChk.Check3.Width := TextWidthByFont(Ctrl.WHChk.Check3.Font.Handle, Ctrl.WHChk.Check3.Caption)+20; 3739 Ctrl.WHChk.Check3.Height := TextHeightByFont(Ctrl.WHChk.check3.Font.Handle, Ctrl.WHChk.check3.Caption)+4; 3740 if (LineWidth + Ctrl.WHChk.Check3.Width) > PWidth - 10 then 3741 begin 3742 LineWidth := WrapLeft; 3743 Y := Ctrl.WHChk.Check2.Top + Ctrl.WHChk.Check2.Height; 3744 Nextline(Y); 3745 end; 3746 Ctrl.WHChk.Check3.Top := Y + 5; 3747 Ctrl.WHChk.Check3.OnClick := Prompt.PromptChange; 3748 Ctrl.WHChk.Check3.Checked := (WHResultChk = 'U'); 3749 Ctrl.WHChk.Check3.Left := LineWidth; 3750 Y := Ctrl.WHChk.Check3.Top + Ctrl.WHChk.Check3.Height; 3751 Nextline(Y); 3752 end 3753 else DoLbl := FALSE; 3754 end 3755 else DoLbl :=FALSE; 3756 end; 3757 3758 ptWHNotPurp: 3759 begin 3760 NextLine(Y); 3761 Ctrl.WHChk := TWHCheckBox.Create(AOwner); 3762 Ctrl.ctrl.Parent := AParent; 3763 Ctrl.WHChk.Flbl := TLabel.Create(AOwner); 3764 Ctrl.WHChk.Flbl.Parent := Ctrl.WHChk.Parent; 3765 Ctrl.WHChk.Flbl.Caption := Prompt.Caption; 3896 ProcessLabel(Prompt.Required, TRUE, Ctrl.WHChk.Parent, Ctrl.WHChk); 3897 Ctrl.WHChk.Flbl := lblCtrl; 3898 if lblCtrl is TWinControl then 3899 TWinControl(lblCtrl).TabOrder := Ctrl.WHChk.TabOrder; 3766 3900 Ctrl.WHChk.Flbl.Top := Y + 7; 3767 3901 Ctrl.WHChk.Flbl.Left := NewLInePromptGap+30; 3768 3902 WrapLeft := Ctrl.WHChk.Flbl.Left; 3769 Ctrl.WHChk.Flbl.Width := TextWidthByFont(Ctrl.WHChk.Flbl.Font.Handle, Ctrl.WHChk.Flbl.Caption)+25; 3770 Ctrl.WHChk.Flbl.Height := TextHeightByFont(Ctrl.WHChk.Flbl.Font.Handle, Ctrl.WHChk.Flbl.Caption)+4; 3903 // Ctrl.WHChk.Flbl.Width := TextWidthByFont( 3904 // TExposedComponent(Ctrl.WHChk.Flbl).Font.Handle, 3905 // TExposedComponent(Ctrl.WHChk.Flbl).Caption)+25; 3906 // Ctrl.WHChk.Flbl.Height := TextHeightByFont( 3907 // TExposedComponent(Ctrl.WHChk.Flbl).Font.Handle, 3908 // TExposedComponent(Ctrl.WHChk.Flbl).Caption)+4; 3771 3909 LineWidth := WrapLeft + Ctrl.WHChk.Flbl.Width+10; 3772 if Prompt.Required then3773 Ctrl.WHChk.Flbl.Caption := '* '+Ctrl.WHChk.Flbl.Caption;3774 3910 Ctrl.WHChk.Check2 := TWHCheckBox.Create(AOwner); 3775 3911 Ctrl.WHChk.Check2.Parent := Ctrl.WHChk.Parent; … … 3782 3918 Ctrl.WHChk.Height := TextHeightByFont(Ctrl.WHChk.Font.Handle, Ctrl.WHChk.Caption)+4; 3783 3919 if (LineWidth + Ctrl.WHChk.Width) > PWidth - 10 then 3784 3785 3786 3787 3788 3920 begin 3921 LineWidth := WrapLeft; 3922 Y := Ctrl.WHChk.Flbl.Top + Ctrl.WHChk.Flbl.Height; 3923 Nextline(Y); 3924 end; 3789 3925 Ctrl.WHChk.Top := Y + 7; 3790 3926 Ctrl.WHChk.Left := LineWidth; … … 3796 3932 Ctrl.WHChk.Check2.Height := TextHeightByFont(Ctrl.WHChk.check2.Font.Handle, Ctrl.WHChk.check2.Caption)+4; 3797 3933 if (LineWidth + Ctrl.WHChk.Check2.Width) > PWidth - 10 then 3798 3799 3800 3801 3802 3934 begin 3935 LineWidth := WrapLeft; 3936 Y := Ctrl.WHChk.Top + Ctrl.WHChk.Height; 3937 Nextline(Y); 3938 end; 3803 3939 Ctrl.WHChk.Check2.Top := Y + 7; 3804 3940 Ctrl.WHChk.Check2.Left := LineWidth; … … 3810 3946 Ctrl.WHChk.Check3.Height := TextHeightByFont(Ctrl.WHChk.check3.Font.Handle, Ctrl.WHChk.check3.Caption)+4; 3811 3947 if (LineWidth + Ctrl.WHChk.Check3.Width) > PWidth - 10 then 3812 3813 3814 3815 3816 3948 begin 3949 LineWidth := WrapLeft; 3950 Y := Ctrl.WHChk.Check2.Top + Ctrl.WHChk.Check2.Height; 3951 Nextline(Y); 3952 end; 3817 3953 Ctrl.WHChk.Check3.Top := Y + 7; 3818 3954 Ctrl.WHChk.Check3.OnClick := Prompt.PromptChange; … … 3821 3957 Y := Ctrl.WHChk.Check3.Top + Ctrl.WHChk.Check3.Height; 3822 3958 Nextline(Y); 3823 Ctrl.WHChk.Fbutton := T Button.Create(AOwner);3959 Ctrl.WHChk.Fbutton := TCPRSDialogButton.Create(AOwner); 3824 3960 Ctrl.WHChk.FButton.Parent := Ctrl.WHChk.Parent; 3825 3961 Ctrl.WHChk.FButton.Enabled:=(Pos('L',WHResultNot)>0); … … 3830 3966 Ctrl.WHChk.FButton.Width := TextWidthByFont(Ctrl.WHChk.FButton.Font.Handle, Ctrl.WHChk.FButton.Caption) + 13; 3831 3967 Ctrl.WHChk.FButton.Height := TextHeightByFont(Ctrl.WHChk.FButton.Font.Handle, Ctrl.WHChk.FButton.Caption) + 13; 3968 UpdateColorsFor508Compliance(Ctrl.WHChk); 3969 UpdateColorsFor508Compliance(Ctrl.WHChk.Flbl); 3970 UpdateColorsFor508Compliance(Ctrl.WHChk.Check2); 3971 UpdateColorsFor508Compliance(Ctrl.WHChk.Check3); 3972 UpdateColorsFor508Compliance(Ctrl.WHChk.FButton); 3973 ScreenReaderSupport(Ctrl.WHChk); 3974 ScreenReaderSupport(Ctrl.WHChk.Check2); 3975 ScreenReaderSupport(Ctrl.WHChk.Check3); 3976 ScreenReaderSupport(Ctrl.WHChk.FButton); 3832 3977 LineWidth := Ctrl.WHChk.FButton.Left + Ctrl.WHChk.FButton.Width; 3833 3978 if piece(Prompt.FRec4,u,12)='1' then 3979 begin 3980 Ctrl.WHChk.FPrintNow :=TCPRSDialogCheckBox.Create(AOwner); 3981 Ctrl.WHChk.FPrintNow.Parent := Ctrl.WHChk.Parent; 3982 Ctrl.WHChk.FPrintNow.ShowHint := true; 3983 Ctrl.WHChk.FPrintNow.Hint := 'Letter will print after "Finish" button is clicked'; 3984 Ctrl.WHChk.FPrintNow.Caption:='Print Now'; 3985 Ctrl.WHChk.FPrintNow.Width := TextWidthByFont(Ctrl.WHChk.FPrintNow.Font.Handle, Ctrl.WHChk.FPrintNow.Caption)+20; 3986 Ctrl.WHChk.FPrintNow.Height := TextHeightByFont(Ctrl.WHChk.FPrintNow.Font.Handle, Ctrl.WHChk.FPrintNow.Caption)+4; 3987 if (LineWidth + Ctrl.WHChk.FPrintNow.Width) > PWidth - 10 then 3834 3988 begin 3835 Ctrl.WHChk.FPrintNow :=TORCheckBox.Create(AOwner); 3836 Ctrl.WHChk.FPrintNow.Parent := Ctrl.WHChk.Parent; 3837 Ctrl.WHChk.FPrintNow.ShowHint := true; 3838 Ctrl.WHChk.FPrintNow.Hint := 'Letter will print after "Finish" button is clicked'; 3839 Ctrl.WHChk.FPrintNow.Caption:='Print Now'; 3840 Ctrl.WHChk.FPrintNow.Width := TextWidthByFont(Ctrl.WHChk.FPrintNow.Font.Handle, Ctrl.WHChk.FPrintNow.Caption)+20; 3841 Ctrl.WHChk.FPrintNow.Height := TextHeightByFont(Ctrl.WHChk.FPrintNow.Font.Handle, Ctrl.WHChk.FPrintNow.Caption)+4; 3842 if (LineWidth + Ctrl.WHChk.FPrintNow.Width) > PWidth - 10 then 3843 begin 3844 LineWidth := WrapLeft; 3845 Y := Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height; 3846 Nextline(Y); 3847 end; 3848 Ctrl.WHChk.FPrintNow.Left := LineWidth + 15; 3849 Ctrl.WHChk.FPrintNow.Top := Y + 7; 3850 Ctrl.WHChk.FPrintNow.Enabled := (Pos('L',WHResultNot)>0); 3851 Ctrl.WHChk.FPrintNow.Checked :=(WHPrintDevice<>''); 3852 Ctrl.WHChk.FPrintNow.OnClick := Prompt.PromptChange; 3853 MinX :=PWidth; 3854 if (Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height) > (Ctrl.WHChk.FPrintNow.Top + Ctrl.WHChk.FPrintNow.Height) then 3855 Y := Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height + 7 3856 else 3857 Y := Ctrl.WHChk.FPrintNow.Top + Ctrl.WHChk.FPrintNow.Height + 7; 3858 end 3989 LineWidth := WrapLeft; 3990 Y := Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height; 3991 Nextline(Y); 3992 end; 3993 Ctrl.WHChk.FPrintNow.Left := LineWidth + 15; 3994 Ctrl.WHChk.FPrintNow.Top := Y + 7; 3995 Ctrl.WHChk.FPrintNow.Enabled := (Pos('L',WHResultNot)>0); 3996 Ctrl.WHChk.FPrintNow.Checked :=(WHPrintDevice<>''); 3997 Ctrl.WHChk.FPrintNow.OnClick := Prompt.PromptChange; 3998 UpdateColorsFor508Compliance(Ctrl.WHChk.FPrintNow); 3999 MinX :=PWidth; 4000 if (Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height) > (Ctrl.WHChk.FPrintNow.Top + Ctrl.WHChk.FPrintNow.Height) then 4001 Y := Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height + 7 4002 else 4003 Y := Ctrl.WHChk.FPrintNow.Top + Ctrl.WHChk.FPrintNow.Height + 7; 4004 ScreenReaderSupport(Ctrl.WHChk.FPrintNow); 4005 end 3859 4006 else 3860 4007 Y := Ctrl.WHChk.FButton.Top + Ctrl.WHChk.FButton.Height + 7; 3861 4008 NextLine(Y); 3862 4009 end; 3863 4010 3864 4011 ptVisitDate: 3865 4012 begin 3866 Ctrl.dt := T ORDateCombo.Create(AOwner);4013 Ctrl.dt := TCPRSDialogDateCombo.Create(AOwner); 3867 4014 Ctrl.ctrl.Parent := AParent; 3868 4015 Ctrl.dt.LongMonths := TRUE; … … 3877 4024 end; 3878 4025 Ctrl.dt.OnChange := Prompt.PromptChange; 4026 UpdateColorsFor508Compliance(Ctrl.dt); 3879 4027 DoLbl := TRUE; 3880 4028 MinX := Ctrl.dt.Width; … … 3884 4032 ptPrimaryDiag, ptAdd2PL, ptContraindicated: 3885 4033 begin 3886 Ctrl.cb := T ORCheckBox.Create(AOwner);4034 Ctrl.cb := TCPRSDialogCheckBox.Create(AOwner); 3887 4035 Ctrl.ctrl.Parent := AParent; 3888 4036 Ctrl.cb.Checked := (Prompt.Value = '1'); … … 3895 4043 Ctrl.cb.Width := 17; 3896 4044 Ctrl.cb.OnClick := Prompt.PromptChange; 4045 UpdateColorsFor508Compliance(Ctrl.cb); 3897 4046 MinX := Ctrl.cb.Width; 3898 4047 end; … … 3902 4051 if(pt = ptSubComment) then 3903 4052 begin 3904 Ctrl.cb := T ORCheckBox.Create(AOwner);4053 Ctrl.cb := TCPRSDialogCheckBox.Create(AOwner); 3905 4054 Ctrl.ctrl.Parent := AParent; 3906 4055 Ctrl.cb.Checked := (Prompt.Value = '1'); … … 3909 4058 Ctrl.cb.OnClick := SubCommentChange; 3910 4059 Ctrl.cb.Tag := Integer(Prompt); 4060 UpdateColorsFor508Compliance(Ctrl.cb); 3911 4061 MinX := Ctrl.cb.Width; 3912 4062 end … … 3917 4067 if(vt = vtPain) then 3918 4068 begin 3919 Ctrl.cbo := T ORComboBox.Create(AOwner);4069 Ctrl.cbo := TCPRSDialogComboBox.Create(AOwner); 3920 4070 Ctrl.ctrl.Parent := AParent; 3921 4071 Ctrl.cbo.Style := orcsDropDown; … … 3934 4084 ElementChecked := nil; 3935 4085 end; 4086 UpdateColorsFor508Compliance(Ctrl.cbo); 3936 4087 end 3937 4088 else … … 3940 4091 Ctrl.ctrl.Parent := AParent; 3941 4092 MinX := TextWidthByFont(Ctrl.vedt.Font.Handle, '12345.67'); 3942 Ctrl.edt.OnKeyPress := Prompt.EditKeyPress; 3943 Ctrl.edt.OnChange := Prompt.PromptChange; 3944 Ctrl.edt.OnExit := Prompt.VitalVerify; 4093 Ctrl.vedt.OnKeyPress := Prompt.EditKeyPress; 4094 Ctrl.vedt.OnChange := Prompt.PromptChange; 4095 Ctrl.vedt.OnExit := Prompt.VitalVerify; 4096 UpdateColorsFor508Compliance(Ctrl.vedt); 3945 4097 if(vt in [vtTemp, vtHeight, vtWeight]) then 3946 4098 begin 3947 4099 HasVCombo := TRUE; 3948 Ctrl.vedt. FLinkedCombo := TVitalComboBox.Create(AOwner);3949 Ctrl.vedt. FLinkedCombo.Parent := AParent;3950 Ctrl.vedt. FLinkedCombo.OnChange := Prompt.PromptChange;3951 Ctrl.vedt. FLinkedCombo.Tag := VitalControlTag(vt, TRUE);3952 Ctrl.vedt. FLinkedCombo.OnExit := Prompt.VitalVerify;3953 Ctrl.vedt. FLinkedCombo.FLinkedEdit := Ctrl.vedt;4100 Ctrl.vedt.LinkedCombo := TVitalComboBox.Create(AOwner); 4101 Ctrl.vedt.LinkedCombo.Parent := AParent; 4102 Ctrl.vedt.LinkedCombo.OnChange := Prompt.PromptChange; 4103 Ctrl.vedt.LinkedCombo.Tag := VitalControlTag(vt, TRUE); 4104 Ctrl.vedt.LinkedCombo.OnExit := Prompt.VitalVerify; 4105 Ctrl.vedt.LinkedCombo.LinkedEdit := Ctrl.vedt; 3954 4106 case vt of 3955 4107 vtTemp: 3956 4108 begin 3957 Ctrl.vedt. FLinkedCombo.Items.Add('F');3958 Ctrl.vedt. FLinkedCombo.Items.Add('C');4109 Ctrl.vedt.LinkedCombo.Items.Add('F'); 4110 Ctrl.vedt.LinkedCombo.Items.Add('C'); 3959 4111 end; 3960 4112 3961 4113 vtHeight: 3962 4114 begin 3963 Ctrl.vedt. FLinkedCombo.Items.Add('IN');3964 Ctrl.vedt. FLinkedCombo.Items.Add('CM');4115 Ctrl.vedt.LinkedCombo.Items.Add('IN'); 4116 Ctrl.vedt.LinkedCombo.Items.Add('CM'); 3965 4117 end; 3966 4118 3967 4119 vtWeight: 3968 4120 begin 3969 Ctrl.vedt. FLinkedCombo.Items.Add('LB');3970 Ctrl.vedt. FLinkedCombo.Items.Add('KG');4121 Ctrl.vedt.LinkedCombo.Items.Add('LB'); 4122 Ctrl.vedt.LinkedCombo.Items.Add('KG'); 3971 4123 end; 3972 4124 3973 4125 end; 3974 Ctrl.vedt.FLinkedCombo.SelectByID(Prompt.VitalUnitValue); 3975 if(Ctrl.vedt.FLinkedCombo.ItemIndex < 0) then 3976 Ctrl.vedt.FLinkedCombo.ItemIndex := 0; 3977 Ctrl.vedt.FLinkedCombo.Width := TextWidthByFont(Ctrl.vedt.Font.Handle, 3978 Ctrl.vedt.FLinkedCombo.Items[1]) + 30; 3979 Ctrl.vedt.FLinkedCombo.SelLength := 0; 3980 inc(MinX, Ctrl.vedt.FLinkedCombo.Width); 4126 Ctrl.vedt.LinkedCombo.SelectByID(Prompt.VitalUnitValue); 4127 if(Ctrl.vedt.LinkedCombo.ItemIndex < 0) then 4128 Ctrl.vedt.LinkedCombo.ItemIndex := 0; 4129 Ctrl.vedt.LinkedCombo.Width := TextWidthByFont(Ctrl.vedt.Font.Handle, 4130 Ctrl.vedt.LinkedCombo.Items[1]) + 30; 4131 Ctrl.vedt.LinkedCombo.SelLength := 0; 4132 UpdateColorsFor508Compliance(Ctrl.vedt.LinkedCombo); 4133 inc(MinX, Ctrl.vedt.LinkedCombo.Width); 3981 4134 end; 3982 4135 if(ElementChecked = Self) then 3983 4136 begin 3984 AutoFocusControl := Ctrl. edt;4137 AutoFocusControl := Ctrl.vedt; 3985 4138 ElementChecked := nil; 3986 4139 end; … … 3993 4146 if pt = ptDataList then 3994 4147 begin 3995 Ctrl.cbo := T ORComboBox.Create(AOwner);4148 Ctrl.cbo := TCPRSDialogComboBox.Create(AOwner); 3996 4149 Ctrl.ctrl.Parent := AParent; 3997 4150 Ctrl.cbo.Style := orcsDropDown; … … 4017 4170 end {loop through FChoices/FChoicesActiveDates} 4018 4171 else 4019 ActChoicesSL.Assign(Prompt.FData.FChoices);4020 Ctrl.cbo.Items.Assign(ActChoicesSL);4172 FastAssign(Prompt.FData.FChoices, ActChoicesSL); 4173 FastAssign(ActChoicesSL, Ctrl.cbo.Items); 4021 4174 Ctrl.cbo.CheckBoxes := TRUE; 4022 4175 Ctrl.cbo.SelectByID(Prompt.Value); … … 4026 4179 Ctrl.cbo.OnChange := Prompt.PromptChange; 4027 4180 Ctrl.cbo.ListItemsOnly := TRUE; 4181 UpdateColorsFor508Compliance(Ctrl.cbo); 4028 4182 if(ElementChecked = Self) then 4029 4183 begin … … 4048 4202 end 4049 4203 else 4050 if(pt = ptMHTest) then4204 if(pt = ptMHTest) or ((pt = ptGaf) and (MHDLLFound = true)) then 4051 4205 begin 4052 Ctrl.btn := T Button.Create(AOwner);4206 Ctrl.btn := TCPRSDialogButton.Create(AOwner); 4053 4207 Ctrl.ctrl.Parent := AParent; 4054 4208 Ctrl.btn.OnClick := Prompt.DoMHTest; 4055 4209 Ctrl.btn.Caption := Prompt.ForcedCaption; 4056 4210 if Piece(Prompt.FData.FRec3,U,13)='1' then 4057 Ctrl.btn.Caption := Ctrl.btn.Caption + ' *'; 4211 begin 4212 Ctrl.btn.Caption := Ctrl.btn.Caption + ' *'; 4213 (Ctrl.btn as ICPRSDialogComponent).RequiredField := TRUE; 4214 end; 4058 4215 MinX := TextWidthByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 13; 4059 4216 Ctrl.btn.Height := TextHeightByFont(Ctrl.btn.Font.Handle, Ctrl.btn.Caption) + 8; 4060 4217 DoLbl := TRUE; 4061 4218 end 4062 4063 if (pt = ptGAF) then4219 else 4220 if ((pt = ptGAF)) and (MHDLLFound = false) then 4064 4221 begin 4065 Ctrl.edt := T Edit.Create(AOwner);4222 Ctrl.edt := TCPRSDialogFieldEdit.Create(AOwner); 4066 4223 Ctrl.ctrl.Parent := AParent; 4067 4224 Ctrl.edt.Text := Prompt.Value; … … 4077 4234 if(User.WebAccess and (GAFURL <> '')) then 4078 4235 begin 4079 HelpBtn := T Button.Create(AOwner);4236 HelpBtn := TCPRSDialogButton.Create(AOwner); 4080 4237 HelpBtn.Parent := AParent; 4081 4238 HelpBtn.Caption := 'Reference Info'; … … 4095 4252 //if(DoLbl) then 4096 4253 begin 4097 if(Prompt.Caption = '') and (not Prompt.Required) then 4098 DoLbl := FALSE 4254 Req := Prompt.Required; 4255 if (not Req) and (pt = ptGaf) and (MHDLLFound = false) then 4256 Req := (Piece(Prompt.FData.FRec3,U,13) = '1'); 4257 ProcessLabel(Req, Prompt.FParent.Enabled, AParent, Ctrl.Ctrl); 4258 if assigned(lblCtrl) then 4259 begin 4260 inc(MinX, lblCtrl.Width + LblGap); 4261 inc(MaxX, lblCtrl.Width + LblGap); 4262 end 4099 4263 else 4100 begin 4101 lbl := TLabel.Create(AOwner); 4102 lbl.Parent := AParent; 4103 lbl.Caption := Prompt.Caption; 4104 if Prompt.Required then 4105 lbl.Caption := lbl.Caption+' *'; 4106 if pt = ptGaf then 4107 begin 4108 if Piece(Prompt.FData.FRec3,U,13)='1' then 4109 lbl.Caption := lbl.Caption + ' *'; 4110 end; 4111 lbl.Enabled := Prompt.FParent.Enabled; 4112 inc(MinX, lbl.Width + LblGap); 4113 inc(MaxX, lbl.Width + LblGap); 4114 end; 4264 DoLbl := FALSE; 4115 4265 end; 4116 4266 … … 4143 4293 //if((DoLbl) or (assigned(Ctrl.Ctrl))) then 4144 4294 begin 4145 if DoLbl then 4146 begin 4147 lbl.Left := X; 4148 lbl.Top := Y; 4149 inc(X, lbl.Width + LblGap); 4150 dec(MinX, lbl.Width + LblGap); 4151 dec(MaxX, lbl.Width + LblGap); 4152 SameLineCtrl.Add(lbl); 4153 end; 4154 if(assigned(Ctrl.Ctrl)) then 4155 begin 4156 Ctrl.Ctrl.Enabled := Prompt.FParent.Enabled; 4157 if not Ctrl.Ctrl.Enabled then 4158 Ctrl.Ctrl.Font.Color := DisabledFontColor; 4159 Ctrl.Ctrl.Left := X; 4160 Ctrl.Ctrl.Top := Y; 4161 SameLineCtrl.Add(Ctrl.Ctrl); 4162 if(assigned(ud)) then 4295 if DoLbl then 4163 4296 begin 4164 SameLineCtrl.Add(ud); 4165 if(assigned(HelpBtn)) then 4297 lblCtrl.Left := X; 4298 lblCtrl.Top := Y; 4299 inc(X, lblCtrl.Width + LblGap); 4300 dec(MinX, lblCtrl.Width + LblGap); 4301 dec(MaxX, lblCtrl.Width + LblGap); 4302 SameLineCtrl.Add(lblCtrl); 4303 end; 4304 if(assigned(Ctrl.Ctrl)) then 4305 begin 4306 if ScreenReaderSystemActive then 4166 4307 begin 4167 SameLineCtrl.Add(HelpBtn); 4168 Ctrl.Ctrl.Width := MinX - HelpBtn.Width - ud.Width; 4169 HelpBtn.Left := X + Ctrl.Ctrl.Width + ud.Width + Gap; 4170 HelpBtn.Top := Y; 4171 HelpBtn.Enabled := Prompt.FParent.Enabled; 4308 if Supports(Ctrl.Ctrl, ICPRSDialogComponent) then 4309 ScreenReaderSystem_CurrentComponent(Ctrl.Ctrl as ICPRSDialogComponent) 4310 else 4311 ScreenReaderSystem_Stop; 4312 end; 4313 Ctrl.Ctrl.Enabled := Prompt.FParent.Enabled; 4314 if not Ctrl.Ctrl.Enabled then 4315 Ctrl.Ctrl.Font.Color := DisabledFontColor; 4316 Ctrl.Ctrl.Left := X; 4317 Ctrl.Ctrl.Top := Y; 4318 SameLineCtrl.Add(Ctrl.Ctrl); 4319 if(assigned(ud)) then 4320 begin 4321 SameLineCtrl.Add(ud); 4322 if(assigned(HelpBtn)) then 4323 begin 4324 SameLineCtrl.Add(HelpBtn); 4325 Ctrl.Ctrl.Width := MinX - HelpBtn.Width - ud.Width; 4326 HelpBtn.Left := X + Ctrl.Ctrl.Width + ud.Width + Gap; 4327 HelpBtn.Top := Y; 4328 HelpBtn.Enabled := Prompt.FParent.Enabled; 4329 end 4330 else 4331 Ctrl.Ctrl.Width := MinX - ud.Width; 4332 ud.Left := X + Ctrl.Ctrl.Width; 4333 ud.Top := Y; 4334 LastX := X + MinX + PromptGap; 4335 ud.Enabled := Prompt.FParent.Enabled; 4172 4336 end 4173 4337 else 4174 Ctrl.Ctrl.Width := MinX - ud.Width; 4175 ud.Left := X + Ctrl.Ctrl.Width; 4176 ud.Top := Y; 4177 LastX := X + MinX + PromptGap; 4178 ud.Enabled := Prompt.FParent.Enabled; 4179 end 4180 else 4181 if(HasVCombo) then 4182 begin 4183 SameLineCtrl.Add(Ctrl.vedt.FLinkedCombo); 4184 Ctrl.Ctrl.Width := MinX - Ctrl.vedt.FLinkedCombo.Width; 4185 Ctrl.vedt.FLinkedCombo.Left := X + Ctrl.Ctrl.Width; 4186 Ctrl.vedt.FLinkedCombo.Top := Y; 4187 LastX := X + MinX + PromptGap; 4188 Ctrl.vedt.FLinkedCombo.Enabled := Prompt.FParent.Enabled; 4189 end 4190 else 4191 begin 4192 Ctrl.Ctrl.Width := MaxX; 4193 LastX := X + MaxX + PromptGap; 4338 if(HasVCombo) then 4339 begin 4340 SameLineCtrl.Add(Ctrl.vedt.LinkedCombo); 4341 Ctrl.Ctrl.Width := MinX - Ctrl.vedt.LinkedCombo.Width; 4342 Ctrl.vedt.LinkedCombo.Left := X + Ctrl.Ctrl.Width; 4343 Ctrl.vedt.LinkedCombo.Top := Y; 4344 LastX := X + MinX + PromptGap; 4345 Ctrl.vedt.LinkedCombo.Enabled := Prompt.FParent.Enabled; 4346 end 4347 else 4348 begin 4349 Ctrl.Ctrl.Width := MaxX; 4350 LastX := X + MaxX + PromptGap; 4351 end; 4194 4352 end; 4195 4353 end; 4196 end;4197 4354 end; 4198 4355 if(assigned(ud)) then … … 4206 4363 end; 4207 4364 end; 4365 4366 procedure UpdatePrompts(EnablePanel: boolean; ClearCB: boolean); 4367 begin 4368 if EnablePanel then 4369 begin 4370 if not ScreenReaderSystemActive then 4371 begin 4372 pnl.TabStop := TRUE; {tab through the panels instead of the checkboxes} 4373 pnl.OnEnter := FieldPanelEntered; 4374 pnl.OnExit := FieldPanelExited; 4375 end; 4376 if ClearCB then 4377 cb := nil; 4378 end; 4379 4380 if (FChecked and assigned(FPrompts) and (FPrompts.Count > 0)) then 4381 begin 4382 AddPrompts(FALSE, BaseParent, ParentWidth, Y); 4383 end 4384 else 4385 inc(Y, pnl.Height); 4386 end; 4208 4387 4209 4388 begin 4210 4389 Result := nil; 4390 cb := nil; 4391 pnl := nil; 4211 4392 AutoFocusControl := nil; 4212 4393 X := TrueIndent; … … 4221 4402 begin 4222 4403 inc(Y,Gap); 4223 pnl := GetPanel(EntryID, CRLFText(FText), ParentWidth - X - (Gap * 2) );4404 pnl := GetPanel(EntryID, CRLFText(FText), ParentWidth - X - (Gap * 2), nil); 4224 4405 pnl.Left := X; 4225 4406 pnl.Top := Y; 4226 if (FChecked and assigned(FPrompts) and (FPrompts.Count > 0)) then 4227 begin 4228 cb := nil; 4229 AddPrompts(FALSE, BaseParent, ParentWidth, Y); 4230 end 4231 else 4232 inc(Y,pnl.Height); 4407 UpdatePrompts(ScreenReaderSystemActive, TRUE); 4233 4408 end; 4234 4409 end … … 4236 4411 begin 4237 4412 inc(Y,Gap); 4238 cb := T ORCheckBox.Create(AOwner);4413 cb := TCPRSDialogParentCheckBox.Create(AOwner); 4239 4414 cb.Parent := BaseParent; 4240 4415 cb.Left := X; … … 4245 4420 cb.Checked := FChecked; 4246 4421 cb.Width := ParentWidth - X - Gap; 4247 cb.Caption := CRLFText(FText); 4422 if not ScreenReaderSystemActive then 4423 cb.Caption := CRLFText(FText); 4248 4424 cb.AutoAdjustSize; 4249 4425 cbSingleLine := cb.SingleLine; 4250 cb.AutoSize := FALSE;4426 // cb.AutoSize := FALSE; 4251 4427 cb.WordWrap := FALSE; 4252 cb.Caption := ''; 4253 cb.Width := 13; 4254 cb.Height := 17; 4255 cb.TabStop := False; {take checkboxes out of the tab order} 4256 pnl := GetPanel(EntryID, CRLFText(FText), ParentWidth - X - (Gap * 2) - IndentGap); 4428 cb.Caption := ' '; 4429 // cb.Width := 13; 4430 // cb.Height := 17; 4431 if not ScreenReaderSystemActive then 4432 cb.TabStop := False; {take checkboxes out of the tab order} 4433 pnl := GetPanel(EntryID, CRLFText(FText), ParentWidth - X - (Gap * 2) - IndentGap, cb); 4257 4434 pnl.Left := X + IndentGap; 4258 4435 pnl.Top := Y; 4259 4436 cb.Associate := pnl; 4260 4437 pnl.Tag := Integer(cb); {So the panel can check the checkbox} 4261 pnl.TabStop := TRUE; {tab through the panels instead of the checkboxes}4262 4263 4438 cb.OnClick := cbClicked; 4264 pnl.OnEnter := FieldPanelEntered; 4265 pnl.OnExit := FieldPanelExited; 4266 TFieldPanel(pnl).OnKeyPress := FieldPanelKeyPress; 4439 cb.OnEnter := cbEntered; 4440 if ScreenReaderSystemActive then 4441 cb.OnExit := ParentCBExit; 4442 4443 UpdateColorsFor508Compliance(cb); 4444 pnl.OnKeyPress := FieldPanelKeyPress; 4267 4445 pnl.OnClick := FieldPanelOnClick; 4268 4446 for i := 0 to pnl.ControlCount - 1 do 4269 if ( pnl.Controls[i] is TLabel) and4447 if ((pnl.Controls[i] is TLabel) or (pnl.Controls[i] is TVA508StaticText)) and 4270 4448 not (fsUnderline in TLabel(pnl.Controls[i]).Font.Style) then //If this isn't a hyperlink change then event handler 4271 4449 TLabel(pnl.Controls[i]).OnClick := FieldPanelLabelOnClick; … … 4275 4453 cb.RadioStyle := TRUE; 4276 4454 4277 if (FChecked and assigned(FPrompts) and (FPrompts.Count > 0)) then 4278 AddPrompts(FALSE, BaseParent, ParentWidth, Y) 4279 else 4280 inc(Y, pnl.Height); 4455 UpdatePrompts(TRUE, FALSE); 4281 4456 end; 4282 4457 … … 4293 4468 PrntWidth := gb.Width - (Gap * 2); 4294 4469 gb.Caption := BoxCaption; 4470 // if ScreenReaderSystemActive then 4471 // begin 4472 // ScreenReaderSystem_AddText(gb.Caption + ','); 4473 // end; 4295 4474 gb.Enabled := EnableChildren; 4296 4475 if(not EnableChildren) then 4297 4476 gb.Font.Color := DisabledFontColor; 4477 UpdateColorsFor508Compliance(gb); 4298 4478 prnt := gb; 4299 4479 if(gb.Caption = '') then … … 4340 4520 Result := AutoFocusControl 4341 4521 end; 4522 if ScreenReaderSystemActive then 4523 ScreenReaderSystem_Stop; 4342 4524 end; 4343 4525 … … 4455 4637 end; 4456 4638 if FReminder.FNoResolve then 4457 Lst.Add(txt) 4639 begin 4640 StripScreenReaderCodes(txt); 4641 Lst.Add(txt); 4642 end 4458 4643 else 4459 4644 WordWrap(txt, Lst, ilvl); … … 4474 4659 Prompt := TRemPrompt(FParent.FPrompts[i]); 4475 4660 if(Prompt.FIsShared) and (Prompt.FSharedChildren.IndexOf(Self) >= 0) then 4476 WordWrap(Prompt.NoteText, Lst, ilvl); 4661 begin 4662 //AGP Change MH dll 4663 if (Prompt.PromptType = ptMHTest) then WordWrap(Prompt.NoteText, Lst, ilvl, 4, True) 4664 else WordWrap(Prompt.NoteText, Lst, ilvl); 4665 end; 4477 4666 end; 4478 4667 end; … … 4481 4670 begin 4482 4671 for i := 0 to FChildren.Count-1 do 4672 begin 4483 4673 TRemDlgElement(FChildren[i]).AddText(Lst); 4674 end; 4484 4675 end; 4485 4676 finally … … 4673 4864 end; 4674 4865 //(AGP Change 24.9 add check to see if MH tests are required) 4675 if ((Pt = ptMHTest) or (Pt = ptGAF)) and ( Piece(Prompt.FData.FRec3,U,13) = '1') and4866 if ((Pt = ptMHTest) or (Pt = ptGAF)) and (StrtoInt(Piece(Prompt.FData.FRec3,U,13)) > 0) and 4676 4867 (not Prompt.Forced) then 4677 4868 begin 4869 if (Piece(Prompt.FData.FRec3,U,13) = '2') and (Prompt.FMHTestComplete = 0) then break; 4678 4870 if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 2) then 4679 4871 begin … … 4688 4880 end; 4689 4881 end; 4690 if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 0) or ( Prompt.FValue = '') then4882 if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 0) or ((Prompt.FValue = '') and (Pos('New MH dll',Prompt.FValue) = 0)) then 4691 4883 begin 4692 4884 if Prompt.FValue = '' then … … 4697 4889 WordWrap(' ',List,65,6); 4698 4890 end; 4891 if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 0) and (Pos('New MH dll',Prompt.FValue) > 0) then 4892 begin 4893 WordWrap('MH test ' + Piece(Prompt.FData.FRec3, U, 8) + ' is not complete', List, 65, 6); 4894 WordWrap(' ',List,65,6); 4895 end; 4699 4896 if (Pt = ptGAF) and ((Prompt.FValue = '0') or (Prompt.FValue = '')) then 4700 4897 begin … … 4708 4905 begin 4709 4906 cReq := ChildrenRequired; 4710 if(cReq in [crOne, crAtLeastOne ]) then4907 if(cReq in [crOne, crAtLeastOne, crAll]) then 4711 4908 begin 4712 4909 cnt := 0; … … 4724 4921 msg := 'One or more selections required' 4725 4922 else 4923 if (cReq = crAll) and (cnt < FChildren.Count) then 4924 msg := 'All selections are required' 4925 else 4726 4926 msg := ''; 4727 4927 if(msg <> '') then … … 4779 4979 end; 4780 4980 4781 function TRemDlgElement.ResultDlgID: integer;4782 begin 4783 Result := StrToIntDef(Piece(FRec1, U, 10),0);4981 function TRemDlgElement.ResultDlgID: string; 4982 begin 4983 Result := Piece(FRec1, U, 10); 4784 4984 end; 4785 4985 … … 4869 5069 begin 4870 5070 TmpSL.CommaText := copy(FFieldValues[i],p+1,MaxInt); 4871 F ldData.AddStrings(TmpSL);5071 FastAddStrings(TmpSL, FldData); 4872 5072 TmpSL.Clear; 4873 5073 end; … … 4884 5084 procedure TRemDlgElement.FieldPanelEntered(Sender: TObject); 4885 5085 begin 4886 with T FieldPanel(Sender) do5086 with TDlgFieldPanel(Sender) do 4887 5087 begin 4888 5088 Focus := TRUE; 4889 5089 Invalidate; 4890 if Parent is T FieldPanel then4891 begin 4892 T FieldPanel(Parent).Focus := FALSE;4893 T FieldPanel(Parent).Invalidate;5090 if Parent is TDlgFieldPanel then 5091 begin 5092 TDlgFieldPanel(Parent).Focus := FALSE; 5093 TDlgFieldPanel(Parent).Invalidate; 4894 5094 end; 4895 5095 end; … … 4898 5098 procedure TRemDlgElement.FieldPanelExited(Sender: TObject); 4899 5099 begin 4900 with T FieldPanel(Sender) do5100 with TDlgFieldPanel(Sender) do 4901 5101 begin 4902 5102 Focus := FALSE; 4903 5103 Invalidate; 4904 if Parent is T FieldPanel then4905 begin 4906 T FieldPanel(Parent).Focus := TRUE;4907 T FieldPanel(Parent).Invalidate;5104 if Parent is TDlgFieldPanel then 5105 begin 5106 TDlgFieldPanel(Parent).Focus := TRUE; 5107 TDlgFieldPanel(Parent).Invalidate; 4908 5108 end; 4909 5109 end; … … 4924 5124 begin 4925 5125 // if TFieldPanel(Sender).Focus then 4926 TORCheckBox(T FieldPanel(Sender).Tag).Checked := not FChecked;5126 TORCheckBox(TDlgFieldPanel(Sender).Tag).Checked := not FChecked; 4927 5127 end; 4928 5128 … … 5549 5749 end 5550 5750 else 5551 if pt = ptGAFthen5751 if (pt = ptGAF) and (MHDLLFound = false) then 5552 5752 TmpValue := (Sender as TEdit).Text; 5553 5753 end; … … 5660 5860 var 5661 5861 pt: TRemPromptType; 5662 fmt, tmp, WHValue: string;5862 dateStr, fmt, tmp, WHValue: string; 5663 5863 cnt, i, j, k: integer; 5664 5864 ActDt, InActDt: Double; … … 5690 5890 if(tmp <> '') and (tmp <> '0') and (length(Tmp) = 7) then 5691 5891 begin 5892 dateStr := ''; 5692 5893 if FMonthReq and (copy(tmp,4,2) = '00') then 5693 5894 Result := '' … … 5695 5896 begin 5696 5897 if(copy(tmp,4,4) = '0000') then 5697 fmt := 'YYYY' 5898 begin 5899 fmt := 'YYYY'; 5900 dateStr := ' Exact date is unknown'; 5901 end 5698 5902 else 5699 5903 if(copy(tmp,6,2) = '00') then 5700 fmt := 'MMMM, YYYY' 5904 begin 5905 fmt := 'MMMM, YYYY'; 5906 dateStr := ' Exact date is unknown'; 5907 end 5701 5908 else 5702 5909 fmt := 'MMMM D, YYYY'; 5703 Result := FormatFMDateTimeStr(fmt, tmp); 5910 if dateStr = '' then Result := FormatFMDateTimeStr(fmt, tmp) 5911 else Result := FormatFMDateTimeStr(fmt, tmp) + ' ' + dateStr; 5704 5912 end; 5705 5913 end; … … 5901 6109 Result := FMiscText 5902 6110 else 5903 if pt = ptGAFthen6111 if (pt = ptGAF) and (MHDLLFound = false) then 5904 6112 begin 5905 6113 if(StrToIntDef(Piece(tmp, U, 1),0) <> 0) then 5906 6114 begin 5907 6115 Result := tmp; 6116 end 6117 end 6118 else 6119 if pt = ptMHTest then 6120 Result := FMiscText; 6121 5908 6122 (* 5909 6123 GafDate := Trunc(FParent.FReminder.PCEDataObj.VisitDateTime); … … 5912 6126 CRCode + 'Determined By: ' + FParent.FReminder.PCEDataObj.Providers.PCEProviderName; 5913 6127 *) 5914 end;6128 //end; 5915 6129 end; 5916 6130 end; 5917 5918 6131 end; 5919 6132 if(Result <> '') and (Caption <> '') then 5920 6133 Result := Trim(Caption + ' ' + Trim(Result)); 5921 end;6134 //end; 5922 6135 end; 5923 6136 … … 6106 6319 OK := (assigned(FParent) and assigned(FParent.FData) and 6107 6320 (Piece(FRec4, U, 4) = RemPromptCodes[ptPrimaryDiag])); 6321 if (OK = false) and (Value = 'New MH dll') then OK := true; 6108 6322 if OK then 6109 6323 OK := (not FParent.Historical); … … 6253 6467 begin 6254 6468 Text := VitalValue; 6255 if(assigned( FLinkedCombo)) then6469 if(assigned(LinkedCombo)) then 6256 6470 begin 6257 6471 Tmp := VitalUnitValue; 6258 6472 if(Tmp <> '') then 6259 FLinkedCombo.Text := VitalUnitValue6473 LinkedCombo.Text := VitalUnitValue 6260 6474 else 6261 FLinkedCombo.ItemIndex := 0;6475 LinkedCombo.ItemIndex := 0; 6262 6476 end; 6263 6477 end; … … 6389 6603 begin 6390 6604 vEdt := TVitalEdit(Sender); 6391 vCbo := vEdt. FLinkedCombo;6605 vCbo := vEdt.LinkedCombo; 6392 6606 end 6393 6607 else … … 6395 6609 begin 6396 6610 vCbo := TVitalComboBox(Sender); 6397 vEdt := vCbo. FLinkedEdit;6611 vEdt := vCbo.LinkedEdit; 6398 6612 end 6399 6613 else … … 6473 6687 procedure TRemPrompt.DoMHTest(Sender: TObject); 6474 6688 var 6475 TmpSL : TStringList;6689 TmpSL, tmpScores, tmpResults: TStringList; 6476 6690 i, TestComp: integer; 6477 Before, After: string; 6691 Before, After, Score: string; 6692 MHRequired: boolean; 6478 6693 6479 6694 begin 6480 6695 TestComp := 0; 6696 try 6697 if (sender is TCPRSDialogButton) then 6698 (Sender as TCPRSDialogButton).Enabled := false; 6699 if FParent.FReminder.MHTestArray = nil then FParent.FReminder.MHTestArray := TORStringList.Create; 6481 6700 if(MHTestAuthorized(FData.Narrative)) then 6482 6701 begin … … 6487 6706 else 6488 6707 TmpSL := nil; 6708 if Piece(self.FData.FRec3,U,13) = '1' then MHRequired := True 6709 else MHRequired := false; 6489 6710 Before := GetValue; 6490 After := PerformMHTest(Before, FData.Narrative, TmpSL );6711 After := PerformMHTest(Before, FData.Narrative, TmpSL, MHRequired); 6491 6712 if uinit.TimedOut then After := ''; 6713 if Piece(After, U, 1) = 'New MH dll' then 6714 begin 6715 if Piece(After,U,2)='COMPLETE' then 6716 begin 6717 FParent.FReminder.MHTestArray.Add(FData.Narrative + U + FParent.FReminder.IEN); 6718 self.FMHTestComplete := 1; 6719 Score := Piece(After,U,3); 6720 if FParent.ResultDlgID <> '' then 6721 begin 6722 tmpScores := TStringList.Create; 6723 tmpResults := TStringList.Create; 6724 PiecestoList(copy(score,2,Length(score)),'*',tmpScores); 6725 PiecestoList(FParent.ResultDlgID,'~',tmpResults); 6726 GetMHResultText(FMiscText, tmpResults, tmpScores); 6727 if tmpScores <> nil then tmpScores.Free; 6728 if tmpResults <> nil then tmpResults.Free; 6729 end; 6730 if (FMiscText <> '') then FMiscText := FMiscText + '~<br>'; 6731 if tmpSL <> nil then 6732 begin 6733 for i := 0 to TmpSL.Count-1 do 6734 begin 6735 if(i > 0) then FMiscText := FMiscText + CRCode; 6736 FMiscText := FMiscText + TmpSL[i]; 6737 end; 6738 end; 6739 //end; 6740 //ExpandTIUObjects(FMiscText); 6741 end 6742 else if Piece(After,U,2)='INCOMPLETE' then 6743 begin 6744 FParent.FReminder.MHTestArray.Add(FData.Narrative + U + FParent.FReminder.IEN); 6745 self.FMHTestComplete := 2; 6746 FMiscText := ''; 6747 After := 'X'; 6748 end 6749 else if Piece(After,U,2)='CANCELLED' then 6750 begin 6751 self.FMHTestComplete := 0; 6752 FMiscText := ''; 6753 After := ''; 6754 end; 6755 SetValue(After); 6756 exit; 6757 end; 6492 6758 if pos(U,After)>0 then 6493 6759 begin … … 6498 6764 if(Before <> After) and (not uInit.TimedOut) then 6499 6765 begin 6500 if(After = '') or (FParent.ResultDlgID = 0) then6766 if(After = '') or (FParent.ResultDlgID = '') then 6501 6767 FMiscText := '' 6502 6768 else … … 6531 6797 InfoBox('Not Authorized to score the ' + FData.Narrative + ' test.', 6532 6798 'Insufficient Authorization', MB_OK + MB_ICONERROR); 6799 finally 6800 (Sender as TCPRSDialogButton).Enabled := true; 6801 end; 6533 6802 end; 6534 6803
Note:
See TracChangeset
for help on using the changeset viewer.