Changeset 830 for cprs/trunk/CPRS-Chart/uSignItems.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/uSignItems.pas
r456 r830 11 11 type 12 12 TSigItemType = (siServiceConnected, siAgentOrange, siIonizingRadiation, 13 siEnvironmentalContaminants, siMST, siHeadNeckCancer, siCombatVeteran );13 siEnvironmentalContaminants, siMST, siHeadNeckCancer, siCombatVeteran, siSHAD); 14 14 15 15 TSigItemTagInfo = record … … 33 33 FcbX: array[TSigItemType] of integer; 34 34 function TagInfo(ASigType: TSigItemType; AIndex: integer): TSigItemTagInfo; 35 //function ItemToTag(Info: TSigItemTagInfo): integer;36 //function TagToItem(ATag: integer): TSigItemTagInfo;37 35 procedure cbClicked(Sender: TObject); 38 36 procedure cbEnter(Sender: TObject); … … 42 40 function FindCBValues(ATag: integer): TORCheckBox; 43 41 function GetTempCkBxState(Index: integer; CBValue:TSigItemType): string; 44 42 45 43 protected 46 44 procedure Notification(AComponent: TComponent; Operation: TOperation); override; … … 62 60 procedure CopyCB(FromIndex, ToIndex: integer); //BAPHII 1.3.1 63 61 procedure SetSigItems(Sender: TObject; sourceOrderID: string); //BAPHII 1.3.1 64 //procedure SetSigItems(Sender: TObject; itemsList: TStringList; sourceOrderID: string); //BAPHII 1.3.165 62 function ItemToTag(Info: TSigItemTagInfo): integer; //CQ5074 66 63 function TagToItem(ATag: integer): TSigItemTagInfo; //CQ5074 64 67 65 end; 68 66 69 67 function SigItems: TSigItems; 70 68 function SigItemHeight: integer; 69 function GetAllBtnLeftPos: integer; 71 70 72 71 const 73 74 TC_Order_Error = 'All Service Connection and/or Rated Disabilities questions must be answered.'; 75 72 SIG_ITEM_VERTICAL_PAD = 2; 73 74 TC_Order_Error = 'All Service Connection and/or Rated Disabilities questions must be answered, '+#13+ 75 'and at least one diagnosis selected for each order that requires a diagnosis.'; 76 76 77 77 TX_Order_Error = 'All Service Connection and/or Rated Disabilities questions must be answered, '+#13+ … … 86 86 uSigItems: TSigItems = nil; //BAPHII 1.3.1 87 87 88 88 89 implementation 89 90 90 91 uses 91 92 ORFn, ORNet, uConst, TRPCB, rOrders, rPCE, fOrdersSign, fReview,UBAGlobals, 92 uCore ;93 uCore , VAUtils; 93 94 94 95 type … … 101 102 { siAgentOrange } ('AO', 'Agent Orange Exposure'), 102 103 { siIonizingRadiation } ('IR', 'Ionizing Radiation Exposure'), 103 { siEnvironmentalContaminants } (' EC', 'Environmental Contaminants'),104 { siEnvironmentalContaminants } ('SWAC','Southwest Asia Conditions'), 104 105 { siMST } ('MST', 'MST'), //'Military Sexual Trauma' 105 106 { siHeadNeckCancer } ('HNC', 'Head and/or Neck Cancer'), 106 { siCombatVeteran } ('CV', 'Combat Veteran Related')); 107 { siCombatVeteran } ('CV', 'Combat Veteran Related'), 108 { siSHAD } ('SHD', 'Shipboard Hazard and Defense')); 107 109 108 110 SigItemDisplayOrder: array[TSigItemType] of TSigItemType = … … 112 114 siIonizingRadiation, 113 115 siEnvironmentalContaminants, 116 siSHAD, 114 117 siMST, 115 siHeadNeckCancer 118 siHeadNeckCancer); 116 119 117 120 StsChar: array[ItemStatus] of char = … … 123 126 ColIdx = 30000; 124 127 AllIdx = 31000; 125 NA_FLAGS = 'NNNNNNN ';128 NA_FLAGS = 'NNNNNNNN'; 126 129 127 130 var … … 132 135 thisOrderID: string; 133 136 thisChangeItem: TChangeItem; 137 AllBtnLeft: integer; 134 138 135 139 … … 175 179 176 180 procedure TSigItems.SetSigItems(Sender: TObject; sourceOrderID: string); 177 {178 BAPHII 1.3.1179 }180 181 var 181 182 i: integer; … … 212 213 function SigItemHeight: integer; 213 214 begin 214 Result := MainFontHeight + 2; 215 end; 215 Result := MainFontHeight + 2 + SIG_ITEM_VERTICAL_PAD; 216 end; 217 218 function GetAllBtnLeftPos: integer; 219 begin 220 Result := uSignItems.AllBtnLeft; 221 end; 222 216 223 217 224 { TSigItems } … … 264 271 var 265 272 idx: integer; 266 267 273 begin 268 274 if ItemType = CH_ORD then … … 277 283 var 278 284 i: integer; 279 280 285 begin 281 286 for i := 0 to FItems.Count-1 do … … 334 339 FirstValidItem: TSigItemType; 335 340 x, y, MaxX, i, btnW, btnH, j, dx, ht, idx, dgrp: integer; 336 s, id, Code, cType, Flags: string; 341 s, id, Code, cType, Flags,OrderStatus,CVFlag,ChangedFlags: string; 342 337 343 StsCode: char; 338 344 sx, si: TSigItemType; … … 340 346 StsUsed: array[TSigItemType] of boolean; 341 347 AResponses : TResponses; 342 UFlags : string;348 UFlags,HoldFlags: string; 343 349 thisCB: TORCheckBox; 344 350 cpFlags: string; … … 349 355 350 356 function CreateCB(AParent: TWinControl): TORCheckBox; 351 357 begin 352 358 Result := TORCheckBox.Create(ownr); 353 359 Result.Parent := AParent; … … 359 365 Result.OnEnter := cbEnter; 360 366 Result.OnExit := cbExit; 367 UpdateColorsFor508Compliance(Result); 361 368 Fcb.Add(Result); 362 369 end; 363 370 364 371 begin … … 393 400 if idx > 0 then 394 401 begin 395 if BILLING_AWARE then 396 rpcGetSC4Orders // get SC/EIC information for all CIDC TYPE orders 397 else 398 GetCoPay4Orders; // enforces existing NON CIDC CO-PAY rules 399 for i := 0 to RPCBrokerV.Results.Count-1 do 402 rpcGetSC4Orders; 403 for i := 0 to RPCBrokerV.Results.Count-1 do 400 404 begin 401 405 s := RPCBrokerV.Results[i]; … … 405 409 if (CharAt(piece(s,';',2),1) <> '1') then 406 410 s := piece(s,U,1); 407 end; 408 409 410 411 412 411 end; {End BillingAware } 412 id := piece(s,U,1); 413 idx := FItems.IndexOfPiece(id); 414 415 if idx >= 0 then 416 begin 413 417 FItems.SetStrPiece(idx, 3, '1'); // Mark as read from RPC 414 418 j := 2; 415 419 Flags := BaseFlags; 416 417 repeat 420 repeat 418 421 Code := piece(s,U,j); 419 422 if Code = 'EC' then Code := 'SWAC'; // CQ:15431 ; resolve issue of displaying SWAC vs EC. 420 423 if Code <> '' then 421 424 begin … … 449 452 // new code if deleted order and ba on then 450 453 // reset appropriate tf flags to "?". 451 452 454 453 455 if BILLING_AWARE then … … 489 491 490 492 FStsCount := 0; 493 AllBtnLeft := 0; 491 494 492 495 for si := low(TSigItemType) to high(TSigItemType) do … … 500 503 begin 501 504 s := piece(s, u, 4); // SC/EI 502 // code added 01/17/2006 - check dc'd nurse orders, originals where requiring CIDC if assigned to patient. 505 // code added 01/17/2006 - check dc'd nurse orders, 506 // originals where requiring CIDC if assigned to patient. 503 507 if (BILLING_AWARE) and (not UBACore.IsOrderBillable(Piece(s,U,1))) then 504 508 s := NA_FLAGS; … … 506 510 for si := low(TSigItemType) to high(TSigItemType) do 507 511 if (not StsUsed[si]) and (s[ord(si)+1] <> StsChar[isNA]) then 508 512 begin 509 513 StsUsed[si] := TRUE; 510 514 inc(FStsCount); 511 515 if FStsCount >= FlagCount then break; 512 516 end; 513 517 end; 514 518 … … 537 541 538 542 for si := low(TSigItemType) to high(TSigItemType) do 539 543 begin 540 544 j := lb.Canvas.TextWidth(SigItemDesc[si, sdShort]); 541 545 if btnW < j then 542 546 btnW := j; 543 547 end; 544 548 545 549 inc(btnW, 8); … … 549 553 550 554 for si := high(TSigItemType) downto low(TSigItemType) do 551 555 begin 552 556 FcbX[si] := x - btnW + dx; 553 557 dec(x, btnW + btnGap); 554 558 end; 555 559 556 560 if FStsCount > 1 then 557 561 begin 558 562 FAllCatCheck := FALSE; 559 563 btn := TButton.Create(ownr); … … 564 568 btn.OnClick := cbClicked; 565 569 btn.Left := FcbX[TSigItemType(0)] + lb.Left - dx + 2 - (FcbX[TSigItemType(1)] - FcbX[TSigItemType(0)]); 570 AllBtnLeft := btn.left; 566 571 btn.Top := lb.Top - btn.height - 2; 567 572 btn.Tag := AllIdx; … … 569 574 btn.Hint := 'Set All Related Entries'; 570 575 btn.TabOrder := lb.TabOrder; 576 UpdateColorsFor508Compliance(btn); 571 577 Fcb.Add(btn); 572 578 end; 573 579 574 580 for sx := low(TSigItemType) to high(TSigItemType) do 575 begin581 begin // print buttons on header of columns ie SC,AO,IR, etc.... 576 582 si := SigItemDisplayOrder[sx]; 577 583 FAllCheck[si] := TRUE; … … 590 596 //tab order before listbox but after previous buttons. 591 597 btn.TabOrder := lb.TabOrder; 598 UpdateColorsFor508Compliance(btn); 592 599 Fcb.Add(btn); 593 600 end; 594 601 595 602 FValidGap := ((FcbX[succ(TSigItemType(0))] - FcbX[TSigItemType(0)] - cbWidth) div 2) + 1; … … 599 606 try 600 607 ht := SigItemHeight; 601 FDy := ((ht - cbHeight) div 2) ;608 FDy := ((ht - cbHeight) div 2)+1; 602 609 y := lb.TopIndex; 603 610 FOldDrawItemEvent := TExposedListBox(lb).OnDrawItem; … … 608 615 for i := 0 to FItems.Count-1 do 609 616 begin 610 s := FItems[i];611 617 s := FItems[i]; 618 orderStatus := (Piece(s,u,1)); 612 619 if piece(s,u,3) = '1' then 613 620 begin 614 idx := StrToIntDef(piece(s,U,2),-1);621 idx := StrToIntDef(piece(s,U,2),-1); 615 622 616 623 if idx >= 0 then 617 624 begin 618 625 Flags := piece(s,u,4); 619 626 //loop thru treatment factors 620 627 for sx := low(TSigItemType) to high(TSigItemType) do 621 628 begin 622 si := SigItemDisplayOrder[sx];623 StsCode := Flags[ord(si)+1];624 StsIdx := isNA;629 si := SigItemDisplayOrder[sx]; 630 StsCode := Flags[ord(si)+1]; 631 StsIdx := isNA; 625 632 626 633 for sts := low(ItemStatus) to high(ItemStatus) do 627 634 if StsCode = StsChar[sts] then 628 635 begin 629 StsIdx := sts;630 Break;636 StsIdx := sts; 637 Break; 631 638 end; 632 639 … … 653 660 end; 654 661 //end CQ3301/3302 655 656 //PATCH: Added OR_3_215v26_70 11/07/2007 jb 657 // GWOT - CV Default to Yes. 658 if ( (si = siCombatVeteran) and (StsIdx = isUnKnown) ) then 659 begin 660 StsIdx := isChecked; 661 Flags[7] := 'C'; // HD200866 default as Combat Related - GWOT mandated Change 662 FItems.SetStrPiece(i, 4, Flags); // HD200866 default as Combat Related - GWOT mandated Change 663 end; 664 //End Patch 665 662 if ( (si = siCombatVeteran) and (StsIdx = isUnKnown) ) then 663 begin 664 StsIdx := isChecked; 665 Flags[7] := 'C'; // HD200866 default as Combat Related - GWOT mandated Change 666 FItems.SetStrPiece(i, 4, Flags); // HD200866 default as Combat Related - GWOT mandated Change 667 end; 666 668 case StsIdx of 667 669 isChecked: cb.State := cbChecked; … … 691 693 on ERangeError do 692 694 begin 693 ShowM essage('ERangeError in UpdateListBox' + s);695 ShowMsg('ERangeError in UpdateListBox' + s); 694 696 raise; 695 697 end; … … 802 804 803 805 begin 804 DrawGrid := (Index < flb.Items.Count); 805 if DrawGrid and (trim(Flb.Items[Index]) = '') and 806 (Index = (flb.Items.Count - 1)) then 807 DrawGrid := FALSE; 808 if DrawGrid then 809 dec(Rect.Bottom); 810 OldRect := Rect; 811 812 Rect.Right := FlastValidX - 4; 813 {Begin BillingAware} 814 if BILLING_AWARE then Rect.Right := FLastValidX - 55; 815 {End BillingAware} 816 817 if assigned(FOldDrawItemEvent) then 818 FOldDrawItemEvent(Control, Index, Rect, State) 819 else 820 begin 821 Flb.Canvas.FillRect(Rect); 822 if Index < flb.Items.Count then 823 Flb.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top, FilteredString(Flb.Items[Index])); 824 end; 825 826 if DrawGrid then 827 begin 828 Flb.Canvas.Pen.Color := clBtnFace; 829 Flb.Canvas.MoveTo(Rect.Left, Rect.Bottom); 830 Flb.Canvas.LineTo(OldRect.RIght, Rect.Bottom); 831 end; 832 833 if BILLING_AWARE then OldRect.Left := Rect.Right + 90 834 else OldRect.Left := Rect.Right; 835 836 //// SC Column 837 Flb.Canvas.FillRect(OldRect); 838 for i := 0 to Fcb.Count-1 do 839 begin 840 cb := TORCheckBox(Fcb[i]); 841 842 if TagToItem(cb.Tag).Index = Index then 843 begin 844 cb.Invalidate; 845 cb.Top := Rect.Top + FDy; 846 end; 847 end; 848 849 // EI Columns 850 if DrawGrid then 851 begin 852 for si := low(TSigItemType) to high(TSigItemType) do 806 DrawGrid := (Index < flb.Items.Count); 807 if DrawGrid and (trim(Flb.Items[Index]) = '') and 808 (Index = (flb.Items.Count - 1)) then 809 DrawGrid := FALSE; 810 if DrawGrid then 811 dec(Rect.Bottom); 812 OldRect := Rect; 813 814 Rect.Right := FlastValidX - 4; 815 {Begin BillingAware} 816 if BILLING_AWARE then Rect.Right := FLastValidX - 55; 817 {End BillingAware} 818 819 if assigned(FOldDrawItemEvent) then 820 begin 821 inc(Rect.Bottom); 822 FOldDrawItemEvent(Control, Index, Rect, State); 823 dec(Rect.Bottom); 824 end 825 else 826 begin 827 Flb.Canvas.FillRect(Rect); 828 if Index < flb.Items.Count then 829 Flb.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top, FilteredString(Flb.Items[Index])); 830 end; 831 832 if DrawGrid then 833 begin 834 Flb.Canvas.Pen.Color := Get508CompliantColor(clSilver); 835 Flb.Canvas.MoveTo(Rect.Left, Rect.Bottom); 836 Flb.Canvas.LineTo(OldRect.RIght, Rect.Bottom); 837 end; 838 839 if BILLING_AWARE then OldRect.Left := Rect.Right + 90 840 else OldRect.Left := Rect.Right; 841 842 //// SC Column 843 /// 844 Flb.Canvas.FillRect(OldRect); 845 for i := 0 to Fcb.Count-1 do 846 begin 847 cb := TORCheckBox(Fcb[i]); 848 849 if TagToItem(cb.Tag).Index = Index then 853 850 begin 854 if FcbX[si] > FLastValidX then 855 begin 856 Flb.Canvas.MoveTo(FcbX[si] - FValidGap, Rect.Top); 857 Flb.Canvas.LineTo(FcbX[si] - FValidGap, Rect.Bottom); 858 end; 851 cb.Invalidate; 852 cb.Top := Rect.Top + FDy; 859 853 end; 860 end; 861 854 end; 855 856 // EI Columns 857 if DrawGrid then 858 begin 859 for si := low(TSigItemType) to high(TSigItemType) do 860 begin 861 if FcbX[si] > FLastValidX then 862 begin 863 Flb.Canvas.MoveTo(FcbX[si] - FValidGap, Rect.Top); 864 Flb.Canvas.LineTo(FcbX[si] - FValidGap, Rect.Bottom); 865 end; 866 end; 867 end; 862 868 end; 863 869 … … 913 919 BAOrderList := TStringList.Create; 914 920 BAOrderList.Clear; 915 end;921 end; 916 922 {End BillingAware} 917 923 end; … … 999 1005 Index := StrToInt(Piece(FactorsOut.Strings[y],U,1)); 1000 1006 CopyCBValues(Index,Index); 1001 1007 end; 1002 1008 end; 1003 1009 … … 1029 1035 end; 1030 1036 end; //for 1031 1032 end; 1037 end; 1033 1038 1034 1039 function TSigItems.FindCBValues(ATag: integer):TORCheckBox; … … 1071 1076 on EAccessViolation do 1072 1077 begin 1073 {$ifdef debug}Show Message('EAccessViolation in uSignItems.GetTempCkBxState()');{$endif}1078 {$ifdef debug}Show508Message('EAccessViolation in uSignItems.GetTempCkBxState()');{$endif} 1074 1079 raise; 1075 1080 end; … … 1083 1088 BaseFlags := StringOfChar(StsChar[isNA], FlagCount); 1084 1089 thisChangeItem := TChangeItem.Create; //CQ3301/3302 1090 AllBtnLeft := 0; 1085 1091 1086 1092 finalization
Note:
See TracChangeset
for help on using the changeset viewer.