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

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

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1IBJTBA1 ;ALB/TMK - TPJI BILL CHARGE INFO SCREEN ;01-MAR-1995
2 ;;2.0;INTEGRATED BILLING;**135,265,155,349**;21-MAR-94;Build 46
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5SHEOB(IBI,IBSPL,IBEOBCT,IBCTOF) ; Format EOB called from IBJTBA
6 ; IBSPL = 0 if EOB represents one bill's payment
7 ; = 1 if AR had to split the EOB between multiple bills
8 ; Assumes IBLN is defined and returns it with line count
9 ; Assumes IBEOBDET may be defined as a flag to control detail level of print
10 N X,IBPT,IBCN,IBM,IBM1,IBM2,IBTY,IBPY,IBPR,IBST,IBSTR,IBCA,IBTS,IBTA,Z,Z0
11 S X="0.00"
12 S IBM=$G(^IBM(361.1,IBI,0))
13 S IBTY=$P(IBM,U,4),IBTY=$S(IBTY:"MEDICARE MRA",1:"NORMAL EOB")
14 I IBTY'["MRA",IBSPL S IBTY="A/R SPLIT/COVERS MORE THAN 1 BILL"
15 I $P(IBM,U,13)>1,$P(IBM,U,13)<5 S IBTY=IBTY_" ("_$$EXTERNAL^DILFD(361.1,.13,,$P(IBM,U,13))_")"
16 S IBCN=$P(IBM,U,14),IBPY=$P(IBM,U,2)
17 S:IBPY IBPY=$P($G(^DIC(36,IBPY,0)),U)
18 S IBPR=$$FMTE^XLFDT($P(IBM,U,6)),IBST=$P(IBM,U,16)
19 S IBST=$$EXPAND^IBTRE(361.1,.16,+IBST)
20 S IBM1=$G(^IBM(361.1,IBI,1))
21 ;
22 S IBPT=$P(IBM1,U,2) ; patient responsibility 1.02 field
23 ; If MRA & UB, then calculate patient responsiblity value
24 I $P(IBM,U,4),$$FT^IBCEF(+$P(IBM,U,1))=3 S IBPT=$$PTRESPI^IBCECOB1(IBI)
25 ;
26 S IBCA=$P(IBM1,U)
27 S IBM2=$G(^IBM(361.1,IBI,2)),IBTA=$P(IBM2,U,3)
28 ; if no Total Allowed Amount, sum up amounts on Line Level Adjustment
29 I IBTA="" S IBTA=$$ALLOWED^IBCEMU2(IBI)
30 S IBTS=$P(IBM2,U,4)
31 D MRA2
32 S IBLN=$$SET^IBJTBA("",IBLN)
33 I '$G(IBEOBDET),IBSPL D
34 . S IBSTR=$$SETLN^IBJTBA(" **A/R CORRECTED PAYMENT DATA:","",1,50),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
35 . S IBSTR=$$SETLN^IBJTBA(" TOTAL AMT PD: "_$J(+$P($G(^IBM(361.1,IBI,1)),U,1),"",2),"",1,75),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
36 . S Z=0 F S Z=$O(^IBM(361.1,IBI,8,Z)) Q:'Z S Z0=$G(^(Z,0)) D
37 .. S IBSTR=$$SETLN^IBJTBA($E($J("",8)_$S($P(Z0,U,3):$$BN1^PRCAFN(+$P(Z0,U,3)),1:"[suspense]"_$P(Z0,U))_$J("",25),1,25)_" "_$J(+$P(Z0,U,2),"",2),"",1,75),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
38 ;
39 I $G(IBEOBDET) D
40 . I $P($G(^IBM(361.1,IBI,0)),U,4) D Q ; Medicare MRA processing
41 .. N VALMCNT
42 .. K ^TMP("IBCECSD",$J)
43 .. D GETEOB^IBCECSA6(IBI,0,,+$G(IBLN)-1)
44 .. S Z=0 F S Z=$O(^TMP("IBCECSD",$J,Z)) Q:'Z S IBSTR=$$SETLN^IBJTBA($G(^TMP("IBCECSD",$J,Z,0)),"",1,79),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
45 .. K ^TMP("IBCECSD",$J)
46 .. D EOBERR
47 .. Q
48 . ;
49 . ; Normal EOB processing
50 . N VALMCNT
51 . K ^TMP("PRCA_EOB",$J)
52 . D GETEOB^IBCECSA6(IBI,1)
53 . S Z=0 F S Z=$O(^TMP("PRCA_EOB",$J,IBI,Z)) Q:'Z S IBSTR=$$SETLN^IBJTBA($G(^TMP("PRCA_EOB",$J,IBI,Z)),"",1,79),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
54 . K ^TMP("PRCA_EOB",$J)
55 . D EOBERR
56 . Q
57 ;
58 Q
59 ;
60MRA2 ;
61 N IBD
62 S IBLN=$$SET^IBJTBA("",IBLN)
63 S IBD="EOB/MRA Information"_$S($D(IBCTOF):" ("_$G(IBEOBCT)_" OF "_IBCTOF_")",1:"")
64 S IBSTR=$$SETLN^IBJTBA(IBD,"",30,45),$E(IBSTR,1,2)=">>",IBLN=$$SET^IBJTBA(IBSTR,IBLN)
65 S IBD="EOB Type: "_IBTY,IBSTR=$$SETLN^IBJTBA(IBD,"",5,59)
66 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
67 S IBD="ICN: "_IBCN,IBSTR=$$SETLN^IBJTBA(IBD,"",10,30)
68 S IBD="Patient Resp Amount: "_$S('IBPT:X,1:IBPT)
69 S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,44,35)
70 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
71 S IBD="Payer Name: "_IBPY,IBSTR=$$SETLN^IBJTBA(IBD,"",3,40)
72 S IBD="Total Allowed Amount: "_$S('IBTA:X,1:IBTA)
73 S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,43,36)
74 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
75 S IBD="EOB Date: "_IBPR,IBSTR=$$SETLN^IBJTBA(IBD,"",5,35)
76 S IBD="Total Submitted Charges: "_$S('IBTS:X,1:IBTS)
77 S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,40,39)
78 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
79 S IBD="Svc From Dt: "_$$DAT1^IBOUTL($P(IBM1,U,10))
80 S IBSTR=$$SETLN^IBJTBA(IBD,"",2,38)
81 S IBD="Svc To Dt: "_$$DAT1^IBOUTL($P(IBM1,U,11))
82 S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,54,25)
83 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
84 S IBSTR=""
85 I IBTY["MRA" S IBD="MRA Review Status: "_IBST,IBSTR=$$SETLN^IBJTBA(IBD,"",2,38)
86 S IBD=$S('$G(IBSPL):" ",1:"**")_"Reported Payment Amt: "_$S('IBCA:$J(X,"",2),1:$J(+IBCA,"",2))
87 S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,41,37)
88 S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
89 ;
90 I IBTY["MRA",$D(^IBM(361.1,IBI,21)) D
91 . S IBD=$TR($J("",35)," ","-")_"Review"_$TR($J("",38)," ","-")
92 . S IBSTR=$$SETLN^IBJTBA(IBD,"",1,79),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
93 . S (IBST,IBCN)=0 F S IBCN=$O(^IBM(361.1,IBI,21,IBCN)) Q:'IBCN S X=$G(^(IBCN,0)) D
94 .. S IBST=0
95 .. S IBD="Review Date: "_$$DAT1^IBOUTL($P(X,U))
96 .. S IBSTR=$$SETLN^IBJTBA(IBD,"",1,30)
97 .. S IBD="Reviewed By: "_$P($G(^VA(200,+$P(X,U,2),0)),U)
98 .. S IBSTR=$$SETLN^IBJTBA(IBD,IBSTR,40,39)
99 .. S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
100 .. S IBD=0 F S IBD=$O(^IBM(361.1,IBI,21,IBCN,1,IBD)) Q:'IBD S IBSTR=$$SETLN^IBJTBA($S('IBST:"Comments: ",1:"")_$G(^(IBD,0)),"",1,$S('IBST:69,1:79)),IBST=1,IBLN=$$SET^IBJTBA(IBSTR,IBLN)
101 . I 'IBST D
102 .. S IBSTR=$$SETLN^IBJTBA("None","",1,10)
103 .. S IBLN=$$SET^IBJTBA(IBSTR,IBLN)
104 Q
105 ;
106EOBERR ; Display information about any 361.1 message storage or filing errors
107 I '$O(^IBM(361.1,IBI,"ERR",0)) Q
108 S IBSTR=$$SETLN^IBJTBA(" ** MESSAGE STORAGE ERRORS **","",1,79),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
109 S Z=0 F S Z=$O(^IBM(361.1,IBI,"ERR",Z)) Q:'Z S IBSTR=$$SETLN^IBJTBA($G(^(Z,0)),"",1,79),IBLN=$$SET^IBJTBA(IBSTR,IBLN)
110 Q
111 ;
Note: See TracBrowser for help on using the repository browser.