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

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

initial load of FOIAVistA 6/30/08 version

File size: 5.5 KB
Line 
1IBJDF62 ;ALB/RB - MISC. BILLS FOLLOW-UP REPORT (PRINT) ;15-APR-00
2 ;;2.0;INTEGRATED BILLING;**123,159**;21-MAR-94
3 ;
4EN ; - Print the Follow-up report.
5 S IBQ=0 D NOW^%DTC S IBRUN=$$DAT2^IBOUTL(%) G:IBRPT="S" SUM
6 I 'IBSDV D DET(0) G SUM
7 S IBDIV=""
8 F S IBDIV=$O(VAUTD(IBDIV)) Q:IBDIV="" D Q:IBQ
9 . D DET(IBDIV)
10 ;
11SUM I 'IBQ D PRT^IBJDF63 ; Print summary.
12ENQ K IBN,IBIN,IBC,IBCD,IBC1,IBC2,IBCAT1,IBD,IBDIV,IBGBL,IBPAG,IBP,IBPD,IBPTD,IBQ,IBRUN,%
13 Q
14 ;
15DET(IBDIV) ; - Print report for a specific division.
16 ; Input: IBDIV=Pointer to the division in file #40.8
17 S IBCAT=0
18 F S IBCAT=$O(IBCAT(IBCAT)) Q:'IBCAT D Q:IBQ
19 . S IBCAT1=IBCAT(IBCAT),IBGBL=$S(IBCAT1<5:"IBJDF6P",1:"IBJDF6D")
20 . I IBDIV,IBCAT1'<5 Q
21 . I IBSDV,'IBDIV,IBCAT1<5 Q
22 . I '$D(^TMP(IBGBL,$J,IBDIV,IBCAT)) D HDR1 Q:IBQ D NAR,PAUSE Q
23 . D HDR1 Q:IBQ
24 . S IBIN="" F S IBIN=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN)) Q:IBIN="" D Q:IBQ
25 . . I $Y>(IOSL-5) D PAUSE Q:IBQ D HDR1 Q:IBQ
26 . . D HDR2
27 . . S (IBPTD,IB0,IBD)=""
28 . . F S IBPTD=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD)) Q:IBPTD="" D Q:IBQ
29 . . . I $Y>(IOSL-5) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ
30 . . . S IBPD=$G(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD))
31 . . . D WPAT
32 . . . F S IB0=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0)) Q:IB0="" D Q:IBQ
33 . . . . S IBN=$G(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0))
34 . . . . I $Y>(IOSL-3) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ D WPAT
35 . . . . I IBCAT1<5 D
36 . . . . . W ?71,IB0,?84,$$DAT1^IBOUTL(+IBN),?94,$$DAT1^IBOUTL($P(IBN,U,2))
37 . . . . . W ?104,$$DAT1^IBOUTL($P(IBN,U,3)),?114,$J($P(IBN,U,4),8,2)
38 . . . . . W ?124,$J($P(IBN,U,5),8,2),!
39 . . . . E D
40 . . . . . W ?33,IB0,?47,$$DAT1^IBOUTL(+IBN),?59,$P($P(IBN,U,2),"@@")
41 . . . . . W ?92,$J($P(IBN,U,3),8,2),?103,$J($P(IBN,U,4),8,2)
42 . . . . . W ?114,$J($P(IBN,U,5),8,2),!
43 . . . . ;
44 . . . . ; - Display bill comment history, if necessary.
45 . . . . I IBSH D COM
46 . ;
47 . I 'IBQ D PAUSE
48 ;
49DETQ Q
50 ;
51DASH(X) ; - Return a dashed line.
52 Q $TR($J("",X)," ","=")
53 ;
54PAUSE ; - Page break.
55 I $E(IOST,1,2)'="C-" Q
56 N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
57 F IBX=$Y:1:(IOSL-3) W !
58 S DIR(0)="E" D ^DIR S:$D(DIRUT)!($D(DUOUT)) IBQ=1
59 Q
60 ;
61HDR1 ; - Write the primary report header.
62 I $E(IOST,1,2)="C-"!$G(IBPAG) W @IOF,*13
63 S IBPAG=$G(IBPAG)+1 W "Miscellaneous Bills Follow-Up Report"
64 I IBDIV W " for ",$P($G(^DG(40.8,IBDIV,0)),U)
65 W ?60," Run Date: ",IBRUN,?123,"Page: ",$J(IBPAG,3)
66 ;
67 S X="ALL ACTIVE "_$G(IBCTG(IBCAT(IBCAT)))_" RECEIVABLES "
68 I IBSMN S X=X_"OVER "_IBSMN_" AND LESS THAN "_IBSMX_" DAYS OLD "
69 I IBCAT(IBCAT)<5 D
70 . S X=X_" / BY PATIENT "_$S(IBSN="N":"NAME",1:"LAST 4 DIGITS OF SSN")
71 . S X=X_" ("_$S($G(IBSNA)="ALL":"ALL",1:"From "_$S(IBSNF="":"FIRST",1:IBSNF)_" to "_$S(IBSNL="zzzzz":"LAST",1:IBSNL))_") / "
72 I IBCAT(IBCAT)>4 D
73 . S X=X_" / BY DEBTOR NAME"
74 . S X=X_" ("_$S($G(IBSDA)="ALL":"ALL",1:"From "_$S(IBSDF="":"FIRST",1:IBSDF)_" to "_$S(IBSDL="zzzzz":"LAST",1:IBSDL))_") / "
75 S X=X_$S('IBSAM:"NO ",1:"")_" MINIMUM BALANCE"
76 I IBSAM S X=X_$S(IBSAM:": $"_$FN(IBSAM,",",2),1:"")
77 S X=X_" / "_$S('IBSH:"NO ",IBSH1="A":"ALL ",1:"ONLY ")_"COMMENTS"
78 S X=X_$S($G(IBSH2):" NOT OLDER THAN "_IBSH2_" DAYS",1:"")
79 S X=X_" / '*' AFTER THE PATIENT/DEBTOR NAME = VA EMPLOYEE"
80 F I=1:1 W !,$E(X,1,132) S X=$E(X,133,999) I X="" Q
81 ;
82 I IBCAT1<5 D G HDQ
83 .W !!?84,"Date",?94,"Bill",?104,"Bill",?114,"Original Current"
84 .W !,"Patient (Age)",?33,"SSN",?47,"Other Insurance",?71,"Bill Number"
85 .W ?84,"Prepared From Dte To Date",?116,"Amount Balance"
86 ;
87 W !!?47,"Date Bill",?92,"Original Last Amt Current"
88 W !,"Debtor",?33,"Bill Number Prepared Processed By",?94,"Amount"
89 W ?107,"Paid Balance" S:$G(IBD) IBD=""
90HDQ W !,$$DASH(IOM),!
91 S IBQ=$$STOP^IBOUTL("Miscellaneous Bills Follow-Up Report")
92 Q
93 ;
94HDR2 ; - Write the insurance company sub-header.
95 N X,X13 Q:IBCAT1>4
96 W ?2,"Carrier: ",$P(IBIN,"@@")
97 S X=$G(^DIC(36,+$P(IBIN,"@@",2),.11)),X13=$G(^(.13))
98 I X]"" D
99 .W ", ",$P(X,U),", ",$P(X,U,4),", ",$P($G(^DIC(5,+$P(X,U,5),0)),U,2)," ",$P(X,U,6)
100 .I $P(X13,U,2)]"" W " Billing Phone: ",$P(X13,U,2) Q
101 .I $P(X13,U)]"" W " Main Phone: ",$P(X13,U)
102 ;
103 W !
104 Q
105 ;
106NAR ; - Write detail line (if '$D).
107 N I
108 W !!,"There are no active receivables "
109 I IBSMN W IBSMN,$S(IBSMX>IBSMN:" to "_IBSMX,1:"")," days old "
110 I IBDIV W "for this division."
111 I IBSDV,IBDIV,IBCAT1<5 Q
112 I IBSDV,'IBDIV,IBCAT1'<5 Q
113 F I=1:1:8 S IB(+IBDIV,IBCAT,I)=""
114 Q
115 ;
116WPAT ; - Write patient data.
117 I IBCAT1<5 D Q
118 . W $P(IBPD,U)," (",$P(IBPD,U,2),")",?33,$P(IBPD,U,3),?47,$P(IBPD,U,4)
119 W $P(IBPD,U)
120 Q
121 ;
122COM ; - Write comments
123 N CONT,DIWL,DIWR,IBC,IBC1,IBC2,X
124 ;
125 S (IBC,CONT)=0,IBC1="",DIWL=1,DIWR=104 K ^UTILITY($J,"W")
126 F S IBC=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC)) Q:'IBC D Q:IBQ
127 . I $Y>(IOSL-4) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ D WPAT W !
128 . F S IBC1=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)) Q:IBC1="" D Q:IBQ
129 . . S IBC2=^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)
130 . . I $Y>(IOSL-4) D WCPB Q:IBQ
131 . . I 'IBC1 S IBCD=IBC2 D WCD Q
132 . . S X=IBC2 I $E(X)=" ",$L(X)>1 S $E(X)=""
133 . . D ^DIWP
134 . . I 'CONT,$L(IBC2)<66 D WCTXT Q
135 . . S CONT=$L(IBC2)>65
136 . . I '$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)) D
137 . . . D:$D(^UTILITY($J,"W")) WCTXT
138 K ^UTILITY($J,"W")
139 Q
140 ;
141WCTXT ; - Write comment text
142 N LIN,WLIN
143 S LIN=""
144 F S LIN=$O(^UTILITY($J,"W",1,LIN)) Q:LIN="" D Q:IBQ
145 . S WLIN=$G(^UTILITY($J,"W",1,LIN,0))
146 . I $Y>(IOSL-4) D WCPB Q:IBQ
147 . W:WLIN'="" ?26,WLIN,!
148 K ^UTILITY($J,"W")
149 Q
150 ;
151WCPB ; - Page Break in the middle of Comments
152 D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ
153 W ! D WPAT W ! D WCD W:IBC1>1 ?26,"(continued)",!
154 Q
155 ;
156WCD ; - Write comment date.
157 W ?2,"Comment Date: ",$$DAT1^IBOUTL(IBCD)
158 Q
Note: See TracBrowser for help on using the repository browser.