source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBPAY671.m@ 1732

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

initial load of WorldVistAEHR

File size: 6.1 KB
RevLine 
[613]1FBPAY671 ;AISC/DMK,TET-CH/CNH PAYMENT HISTORY PRINT ;21/NOV/2006
2 ;;3.5;FEE BASIS;**4,32,55,69,101**;JAN 30, 1995;Build 2
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4PRINT ;print data from tmp global
5 S FBOUT=0 D:FBCRT&(FBPG) CR Q:FBOUT
6 S FBHEAD=$S(FBSORT:"VETERAN",1:"VENDOR")
7EN1 N FBI,FBINV ;entry point from fbchdi
8 D HDR S FBVI="" F S FBVI=$O(^TMP($J,"FB",FBPI,FBVI)) Q:FBVI']""!(FBOUT) D:FBSORT SH Q:FBOUT S FBPT="" F S FBPT=$O(^TMP($J,"FB",FBPI,FBVI,FBPT)) Q:FBPT']""!(FBOUT) D Q:FBOUT D CKANC Q:FBOUT
9 .D:'FBSORT SH Q:FBOUT S FBDT=0 F S FBDT=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT)) Q:'FBDT!(FBOUT) S FBI=0 F S FBI=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI)) Q:'FBI!(FBOUT) D Q:FBOUT
10 ..I ($Y+5)>IOSL D PAGE Q:FBOUT
11 ..S FBDATA=^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI),A2=$$EXTRL^FBMRASVR($P(FBDATA,U,3))
12 ..S FBINV=^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI,"FBINV")
13 ..W ! W:$P(FBDATA,U,8)["R" "*" W:$P(FBDATA,U,9)]"" "#"
14 ..W ?2,$P(FBDATA,U,1),?15,$P(FBDATA,U,5),?31,$P(FBDATA,U,6)
15 ..W ?47,$P(FBDATA,U,7),?57,$P(FBINV,U,2)
16 ..W !?2,$P(FBDATA,U,2),?15,$P(FBDATA,U,3),?25,$P(FBINV,U,1)
17 .. ;Print adj reasons, if null then print suspend code
18 ..W ?36,$S($P(FBINV,U,5)]"":$P(FBINV,U,5),1:$P(FBDATA,U,4))
19 ..W ?46,$S($P(FBINV,U,5)]"":$J($P(FBINV,U,6),14),1:$J($P(FBDATA,U,10),14))
20 ..W ?63,$P(FBINV,U,7)
21 .. ;If FPPS Claim ID exists then print it.
22 ..I $P(FBINV,U,3)]"" D
23 ...W !?5,"FPPS Claim ID: ",$P(FBINV,U,3)," FPPS Line Item: ",$P(FBINV,U,4)
24 ..F FBY="DX","PROC" I $D(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI,FBY)) S FBDATA=^(FBY),FBSL=$L(FBDATA,"^") W !?2,FBY,": " F I=1:1:FBSL W $P(FBDATA,U,I)," "
25 ..I $D(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI,"FBCK")) D EFBCK^FBPAY21(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,FBI,"FBCK")) D PMNT^FBAACCB2 K A2
26 Q
27CKANC I +$O(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",0)) D PANC(FBI) Q:FBOUT W !,FBDASH1
28 Q
29PANC(FBI) ;print anc data - FBI = unique number; called by fbpay3
30 S (FBOV,FBK)=0,FBSL=8,FBLOC=1_U_12_U_23_U_33_U_43_U_56_U_62_U_71 D SHA Q:FBOUT
31 F S FBK=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK)) Q:'FBK!(FBOUT) S FBL=0 F S FBL=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK,FBL)) Q:'FBL!(FBOUT) S FBM=0 F S FBM=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK,FBL,FBM)) Q:'FBM!(FBOUT) D
32 .S FBDATA=^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK,FBL,FBM)
33 .S FBV=$P(FBDATA,U,12)_";"_$P(FBDATA,U,13)
34 .D WRT
35 K FBK,FBL,FBM Q
36WRT ;write ancillary info
37 I ($Y+6)>IOSL D PAGE Q:FBOUT D SHA Q:FBOUT D SHA2 Q:FBOUT
38 D:FBOV'=FBV SHA2
39 S FBCKIN=$G(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK,FBL,FBM,"FBCK")) D EFBCK^FBPAY21(FBCKIN)
40 S FBADJ=$G(^TMP($J,"FB",FBPI,FBVI,FBPT,"A",FBK,FBL,FBM,"FBADJ"))
41 W ! W:$G(FBCAN)]"" "+"
42 W ?1,$P(FBDATA,U,1)
43 W ?11,$P($P(FBDATA,U,2),",")
44 W ?22,$P(FBADJ,U,9)
45 W ?31,$J($P(FBADJ,U,2),10)
46 W ?43,$P(FBDATA,U,6)
47 W ?54,$P(FBDATA,U,7)
48 W ?64,$P(FBDATA,U,8)
49 I $P($P(FBDATA,U,2),",",2)]"" D Q:FBOUT
50 . N FBI,FBMOD
51 . F FBI=2:1 S FBMOD=$P($P(FBDATA,U,2),",",FBI) Q:FBMOD="" D Q:FBOUT
52 . . I $Y+7>IOSL D PAGE Q:FBOUT D SHA Q:FBOUT D SHA2 Q:FBOUT W !," (continued)"
53 . . W !?16,"-",FBMOD
54 W !,$P(FBDATA,U,3)
55 W ?13,$P(FBDATA,U,4)
56 W ?23,$S($P(FBADJ,U,3)]"":$P(FBADJ,U,3),1:$P(FBDATA,U,5))
57 W ?33,$J($S($P(FBADJ,U,4)]"":$J($P(FBADJ,U,4),14),1:$P(FBADJ,U,1)),14)
58 W ?48,$P(FBADJ,U,5)
59 W ?60,$P(FBADJ,U,6)
60 ;If FPPS Claim ID exists then print it.
61 I $P(FBADJ,U,7)]"" D
62 .W !?5,"FPPS Claim ID: ",$P(FBADJ,U,7)," FPPS Line Item: ",$P(FBADJ,U,8)
63 W !?4,"Primary Dx: ",$P(FBDATA,U,10),?40,"S/C Condition? ",$P(FBDATA,U,9),?66,"Obl.#: ",$P(FBDATA,U,11)
64 N A2 S A2=$$EXTRL^FBMRASVR($P(FBDATA,U,4))
65 D PMNT^FBAACCB2
66 Q
67HDR ;main header
68 I FBPG>0!FBCRT W @IOF
69 S FBPG=FBPG+1
70 I $D(FBHEAD) D
71 .W !?25,FBHEAD_" PAYMENT HISTORY"
72 .I $G(FB1725R)]"",FB1725R'="A" W " ",$S(FB1725R="M":"for 38 U.S.C. 1725 Claims",1:"excluding 38 U.S.C. 1725 Claims")
73 .W !,?24,$E(FBDASH,1,24),?71,"Page: ",FBPG,!?48,"Date Range: ",$$DATX^FBAAUTL(FBBDATE)," to ",$$DATX^FBAAUTL(FBEDATE)
74 I '$D(FBHEAD) W !?30,"INVOICE DISPLAY",!?29,$E(FBDASH,1,17),!
75 W ! W:FBSORT "Patient: ",FBPNAME,?41,"Patient ID: ",FBPID W:'FBSORT "Vendor: ",FBVNAME,?41,"Vendor ID: ",FBVID
76 W !?(IOM-(13+$L(FBPROG(+FBPI)))/2),"FEE PROGRAM: ",FBPROG(+FBPI)
77 W !?3,"('*' Reimb. to Patient '+' Cancel. Activity '#' Voided Payment)"
78 W !,?3,"(paid symbol: 'R' RBRVS 'F' 75th percentile 'C' contract 'M' Mill Bill"
79 W !,?3," 'U' U&C)"
80 W !?1,"Invoice Date",?15,"Invoice No.",?31,"From Date",?48,"To Date",?57,"Patient Control #"
81 W !?1,"Amt Claimed",?15,"Amt Paid",?25,"Cov Days",?36,"Adj Codes",?49,"Adj Amounts",?63,"Remit Remarks",!,FBDASH
82 Q
83SH ;subheader - vendor if fbsort; patient if 'fbsort, prints when name changed
84 I ($Y+7)>IOSL D:FBCRT CR Q:FBOUT D HDR
85 I FBSORT W !!,"Vendor: ",$P(FBVI,";"),?41,"Vendor ID: ",$P(FBVI,";",2)
86 I 'FBSORT W !!,"Patient: ",$P(FBPT,";"),?41,"Patient ID: ",$$SSNL4^FBAAUTL($$SSN^FBAAUTL($P(FBPT,";",2)))
87 Q
88SHA ;ancillary subheader
89 I ($Y+14)>IOSL D PAGE Q:FBOUT
90 W !?20,">>> ANCILLARY SERVICE PAYMENTS <<<",!
91SHA1 ;subheader for ancillary data
92 W !,?1,"Svc Date",?11,"CPT-MOD ",?21,"Rev Code",?31,"Units Paid",?43,"Batch No.",?54,"Inv No.",?64,"Voucher Date"
93 W !,"Amt Claimed",?13,"Amt Paid",?23,"Adj Code",?36,"Adj Amounts",?48,"Remit Remark",?61,"Patient Account No",!,FBDASH
94 Q
95SHA2 ;subheader for vendor name
96 I ($Y+5)>IOSL D:FBCRT CR Q:FBOUT D HDR,SH,SHA
97 I FBOV'=FBV S FBOV=FBV
98 W !!,"Vendor: ",$P(FBV,";"),?41,"Vendor ID: ",$P(FBV,";",2)
99 Q
100CR ;read for display
101 Q:'FBPG S DIR(0)="E" W ! D ^DIR K DIR S:$D(DUOUT)!($D(DTOUT)) FBOUT=1
102 Q
103PAGE ;new page
104 I FBCRT D CR Q:FBOUT
105 D HDR,SH
106 Q
107WRTDX I $P(FBDX,"^",K)]"" W ?4,"Dx: ",$$ICD9^FBCSV1($P(FBDX,"^",K))," " Q
108 Q
109WRTPC I $P(FBPROC,"^",L)]"" W ?4,"Proc: ",$$ICD0^FBCSV1($P(FBPROC,"^",L))," " Q
110 Q
111WRTSC ;write service connected
112 W !,"SERVICE CONNECTED? ",$S(+VAEL(3):"YES",1:"NO"),!
113 Q
114TRAV ;write out travel payments, (FBPAT,FBSORT) must be defined
115 S FBTRDT=0
116 F S FBTRDT=$O(^TMP($J,"FBTR",FBPAT,FBTRDT)) Q:'FBTRDT S FBTRX=0 F S FBTRX=$O(^TMP($J,"FBTR",FBPAT,FBTRDT,FBTRX)) Q:'FBTRX S FBCKIN=^(FBTRX),A2=$P(FBCKIN,"^") D TRCK Q:FBOUT W:$G(FBTRCK) !,?5,"TRAVEL PAYMENTS: " D K FBTRCK
117 .W ?22,$$DATX^FBAAUTL(FBTRDT),?35,A2
118 .S A2=$$EXTRL^FBMRASVR(A2) D EFBCK^FBPAY21(FBCKIN),PMNT^FBAACCB2
119 .K A2 W ! Q
120 Q
121TRCK I ($Y+5)>IOSL D:FBCRT CR Q:FBOUT D HDR^FBPAY21
122 Q
Note: See TracBrowser for help on using the repository browser.