source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBJTCA1.m@ 1582

Last change on this file since 1582 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 6.4 KB
Line 
1IBJTCA1 ;ALB/ARH - TPI CLAIMS INFO BUILD ;16-FEB-1995
2 ;;2.0;INTEGRATED BILLING;**39,80,106,137,223,276,363**;21-MAR-94;Build 35
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5BLD ; build array for Third Party Joint Inquiry Claims Info screen, IBIFN must be defined
6 ;
7 N X,IBY,IBZ,IBZ0,IBI,IBT,IBD,IBLN,IBLR,IBD0,IBDI1,IBDM,IBDM1,IBDU,IBDS,IBDU2,IBID0,IBID13,IBNC,IBTC,IBTW,IBSW,IBGRPB,IBGRPE,IBWNR,IBDTX,IBBX19,IBPRVO,IBNABP
8 S VALMCNT=0,X="",IBD0=$G(^DGCR(399,+$G(IBIFN),0)) I IBD0="" S VALMQUIT="" G BLDQ
9 F IBI="M","M1","U","S","U2","TX" S @("IBD"_IBI)=$G(^DGCR(399,+IBIFN,IBI))
10 S IBDI1=$P(IBD0,U,21),IBDI1=$S(IBDI1="S":"I2",IBDI1="T":"I3",1:"I1") S IBDI1=$G(^DGCR(399,+IBIFN,IBDI1))
11 S IBID0=$G(^DIC(36,+IBDI1,0)),IBID13=$G(^DIC(36,+IBDI1,.13))
12 ;
13 ;
14 S (IBLN,VALMCNT)=1
15 S (IBNC(1),IBTC(1),IBTC(4))=2,IBTC(5)=78,(IBNC(2),IBTC(2))=42,IBNC(3)=35,IBTW(1)=15,IBTW(2)=16,IBTW(4)=12,IBTW(5)=1,IBSW(1)=23,IBSW(2)=21,IBSW(4)=60,IBSW(5)=1
16 ;
17 S IBGRPB=IBLN,IBLR=1
18 ;
19 S IBT="Insurance Demographics" S IBLN=$$SETN(IBT,IBLN,IBLR,1)
20 S IBWNR=$$WNRBILL^IBEFUNC(IBIFN)
21 S IBNABP=$$NABP^IBNCPDPU(IBIFN)
22 S IBT=$S(IBWNR:" *",1:" ")_"Bill Payer: ",IBD=$P(IBID0,U,1) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
23 S IBT="Claim Address: " D S IBD=$P(IBDM,U,5) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
24 . I $P(IBID0,U,1)'=$P(IBDM,U,4) S IBD=$P(IBDM,U,4) S IBLN=$$SET(IBT,IBD,IBLN,IBLR) S IBT=""
25 I $P(IBDM,U,6)'="" S IBT="",IBD=$P(IBDM,U,6) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
26 I $P(IBDM1,U,1)'="" S IBT="",IBD=$P(IBDM1,U,1) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
27 S IBT="",IBD=$P(IBDM,U,7),IBD=IBD_$S(IBD'="":", ",1:"")_$P($G(^DIC(5,+$P(IBDM,U,8),0)),U,2)_" "_$P(IBDM,U,9),IBLN=$$SET(IBT,IBD,IBLN,IBLR)
28 S IBT="Claim Phone: ",IBD=$P($$BADD^IBJTU3(+IBIFN),U,2) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
29 ;
30 S IBGRPE=IBLN,IBLN=IBGRPB,IBLR=2
31 ;
32 S IBT="Subscriber Demographics" S IBLN=$$SETN(IBT,IBLN,IBLR,1)
33 S IBT="Group Number: ",IBD=$P(IBDI1,U,3) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
34 S IBT="Group Name: ",IBD=$P(IBDI1,U,15) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
35 S IBT="Subscriber ID: ",IBD=$P(IBDI1,U,2) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
36 S IBT="Employer: ",IBD=$$EMPL(+DFN) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
37 S IBT="Insured's Name: ",IBD=$P(IBDI1,U,17) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
38 S IBT="Relationship: ",IBD=$$EXSET^IBJU1($P(IBDI1,U,16),2.312,16) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
39 ;
40 S (IBLN,VALMCNT)=$S(IBLN>IBGRPE:IBLN,1:IBGRPE)
41 S (IBNC(1),IBTC(1))=2,(IBNC(2),IBTC(2))=42,IBNC(3)=29,IBTW(1)=12,IBTW(2)=16,IBSW(1)=26,IBSW(2)=22
42 S (IBT,IBD)="" S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
43 ;
44 I $$FT^IBCEF(IBIFN)=2 D
45 . N IBXDATA,IBXSAVE K ^TMP("IBXSAVE",$J)
46 . D F^IBCEF("N-HCFA 1500 BOX 19",,,IBIFN)
47 . I IBXDATA'="" S IBBX19(1)=$E(IBXDATA,1,40) S:$E(IBXDATA,41,$L(IBXDATA))'="" IBBX19(2)=$E(IBXDATA,41,$L(IBXDATA))
48 ;
49 S IBGRPB=IBLN,IBLR=1
50 S IBT="Claim Information" S IBLN=$$SETN(IBT,IBLN,3,1)
51 S IBT="Bill Type: ",IBD=$$EXSET^IBJU1($P(IBD0,U,5),399,.05) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
52 S IBT="Time Frame: ",IBD=$$EXSET^IBJU1($P(IBD0,U,6),399,.06) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
53 S IBT="Rate Type: ",IBD=$P($G(^DGCR(399.3,+$P(IBD0,U,7),0)),U,1) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
54 S IBT="AR Status: ",IBD=$P($$ARSTATA^IBJTU4(IBIFN),U,1) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
55 S IBT=" Sequence: ",IBD=$P($$EXSET^IBJU1($P(IBD0,U,21),399,.21)," ",1) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
56 S IBT="Purch Svc: ",IBD=$S($P(IBDU2,U,11)="":"NO",1:$$EXPAND^IBTRE(399,233,$P(IBDU2,U,11))),IBLN=$$SET(IBT,IBD,IBLN,4)
57 I $P(IBDM1,"^",8) S IBT=" ECME No: ",IBD=+$P(IBDM1,"^",8),IBLN=$$SET(IBT,IBD,IBLN,IBLR)
58 I $L($P(IBDM1,"^",9)) S IBT="ECME Ap No: ",IBD=$P(IBDM1,"^",9),IBLN=$$SET(IBT,IBD,IBLN,IBLR)
59 I IBNABP'="" S IBT=$S(($L($TR(IBNABP," ",""))=7):" NCPDP No: ",1:" NPI: "),IBD=IBNABP,IBLN=$$SET(IBT,IBD,IBLN,IBLR)
60 I IBWNR S IBT="MRA Status: ",IBD=$S($P(IBDTX,U,5):$P(IBDTX,U,5),1:"NOT RECEIVED"),IBLN=$$SET(IBT,$S(IBD:$$EXPAND^IBTRE(399,24,IBD),1:IBD),IBLN,IBLR)
61 I $G(IBBX19(1))'="" D
62 . S IBT=" Box 19: ",IBD=IBBX19(1),IBLN=$$SET(IBT,IBD,IBLN,IBLR)
63 . I $G(IBBX19(2))'="" S IBT=$J("",11),IBD=IBBX19(2),IBLN=$$SET(IBT,IBD,IBLN,IBLR)
64 ;
65 S IBLR=4,IBPRVO=""
66 S IBT="Providers: ",IBD="NONE"
67 D F^IBCEF("N-ALL PROVIDERS","IBZ",,IBIFN)
68 S IBZ0=0
69 S Z=0
70 F S Z=$O(IBZ(Z)) Q:'Z D
71 . I $G(IBZ(Z)),$G(IBZ(Z,1))'="" S IBLN=$$SET(IBT,"(OLD PROV DATA) "_IBZ(Z,1),IBLN,IBLR),IBZ0=1 Q
72 . I $P($G(IBZ(Z,1)),U)'="" S IBD=$E($$EXPAND^IBTRE(399.0222,.01,Z)_":"_$J("",15),1,15)_$P(IBZ(Z,1),U)_$S($P(IBZ(Z,1),U,4)'="":" ("_$P(IBZ(Z,1),U,4)_")",1:"") S IBLN=$$SET(IBT,IBD,IBLN,IBLR) S IBT=$J("",11),IBZ0=1
73 I 'IBZ0 S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
74 ;
75 S IBGRPE=IBLN,IBLN=IBGRPB+1,IBLR=2
76 ;
77 S IBT="Charge Type: ",IBD=$$EXSET^IBJU1($P(IBD0,U,27),399,.27) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
78 S IBT="Service Dates: ",IBD=$$DATE^IBJU1($P(IBDU,U,1))_" - "_$$DATE^IBJU1($P(IBDU,U,2)) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
79 S IBT="Orig Claim: ",IBD=$$BILL^RCJIBFN2(+IBIFN) S IBLN=$$SET(IBT,$J($P(IBD,U,1),9,2),IBLN,IBLR)
80 S IBT="Balance Due: ",IBD=$J($P(IBD,U,3),9,2) S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
81 I +$P(IBDM,U,2) S IBX=$S($P(IBD0,U,21)="P":2,1:1) D S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
82 . S IBT=$S(IBX=2:"Secondary",1:"Primary")_": ",IBD=$P($G(^DIC(36,+$P(IBDM,U,IBX),0)),U,1)
83 . S IBX=$P(IBDU2,U,(IBX+3)) I +IBX S IBX="("_$J(IBX,0,2)_")" S IBD=$E(IBD,1,(IBSW(IBLR)-$L(IBX)-2))_" "_IBX
84 I +$P(IBDM,U,3) S IBX=$S($P(IBD0,U,21)="T":2,1:3) D S IBLN=$$SET(IBT,IBD,IBLN,IBLR)
85 . S IBT=$S(IBX=2:"Secondary",1:"Tertiary")_": ",IBD=$P($G(^DIC(36,+$P(IBDM,U,IBX),0)),U,1)
86 . S IBX=$P(IBDU2,U,(IBX+3)) I +IBX S IBX="("_$J(IBX,0,2)_")" S IBD=$E(IBD,1,(IBSW(IBLR)-$L(IBX)-2))_" "_IBX
87 S IBLN=$$SET("","",IBLN,5)
88 I IBWNR S IBT="MRA Rec Date: " D S IBLN=$$SET(IBT,IBD,IBLN,2)
89 . N Z
90 . ; find last MRA for receipt date
91 . S (IBD,Z)="" F S Z=$O(^IBM(361.1,"B",IBIFN,Z),-1) Q:'Z I $P($G(^IBM(361.1,Z,0)),U,4)=1 S IBD=$$DATE^IBJU1($P($P(^IBM(361.1,Z,0),U,6),".")) Q
92 F Z=IBLN:1:IBGRPE S IBLN=$$SET("","",IBLN,5)
93 ;
94 S (IBLN,VALMCNT)=$S(IBLN>IBGRPE:IBLN,1:IBGRPE)
95 ;
96 S IBGRPB=IBLN,IBLR=1
97 D CONT^IBJTCA2
98 ;
99 S (IBLN,VALMCNT)=IBLN-1
100 ;
101BLDQ Q
102 ;
103EMPL(DFN) ; returns employer name
104 Q $P($G(^DPT(+DFN,.311)),U,1)
105 ;
106SET(TTL,DATA,LN,LR) ;
107 N IBY
108 S IBY=$J(TTL,IBTW(LR))_DATA D SET1(IBY,LN,IBTC(LR),(IBTW(LR)+IBSW(LR)))
109 S LN=LN+1
110 Q LN
111 ;
112SETN(TTL,LN,LR,RV) ;
113 N IBY
114 S IBY=" "_TTL_" " D SET1(IBY,LN,IBNC(LR),$L(IBY),$G(RV))
115 S LN=LN+1
116 Q LN
117 ;
118SET1(STR,LN,COL,WD,RV) ; set up TMP array with screen data
119 N IBX S IBX=$G(^TMP("IBJTCA",$J,LN,0))
120 S IBX=$$SETSTR^VALM1(STR,IBX,COL,WD)
121 D SET^VALM10(LN,IBX) I $G(RV)'="" D CNTRL^VALM10(LN,COL,WD,IORVON,IORVOFF)
122 Q
Note: See TracBrowser for help on using the repository browser.