source: FOIAVistA/trunk/r/FEE_BASIS-FB/FBPAY21.m@ 1671

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1FBPAY21 ;AISC/CMR-OUTPATIENT PAYMENT HISTORY SORT/PRINT ;21/NOV/2006
2 ;;3.5;FEE BASIS;**4,32,69,101**;JAN 30, 1995;Build 2
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4PRINT ;write output
5 S FBOUT=0 D:FBCRT&(FBPG) CR Q:FBOUT
6 D HDR I FBSORT S FBPAT=FBPNAME I $D(^TMP($J,"FBTR")) S FBTRCK=1 D TRAV^FBPAY671
7 S FBVI="" F S FBVI=$O(^TMP($J,"FB",FBPI,FBVI)) Q:FBVI']""!(FBOUT) D:FBSORT SH Q:FBOUT S FBPT="" D Q:FBOUT
8 .F S FBPT=$O(^TMP($J,"FB",FBPI,FBVI,FBPT)) Q:FBPT']""!(FBOUT) D:'FBSORT SH,SH1 Q:FBOUT S FBDT=0 F S FBDT=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT)) Q:'FBDT!(FBOUT) D
9 ..S L=0 F S L=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,L)) Q:'L!(FBOUT) S M=0 F S M=$O(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,L,M)) Q:'M!(FBOUT) D
10 ...I ($Y+6)>IOSL D PAGE Q:FBOUT
11 ...S FBDATA=^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,L,M)
12 ...S FBCKIN=$G(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,L,M,"FBCK")) D EFBCK(FBCKIN)
13 ...S FBADJ=$G(^TMP($J,"FB",FBPI,FBVI,FBPT,FBDT,L,M,"FBADJ"))
14 ...W !,$S($G(FBCAN)]"":"+",1:"")
15 ...W ?1,$P(FBDATA,U,1)
16 ...W ?11,$P($P(FBDATA,U,2),",")
17 ...W ?22,$P(FBADJ,U,9)
18 ...W ?31,$J($P(FBADJ,U,2),10)
19 ...W ?43,$P(FBDATA,U,6)
20 ...W ?54,$P(FBDATA,U,7)
21 ...W ?64,$P(FBDATA,U,8)
22 ...I $P($P(FBDATA,U,2),",",2)]"" D Q:FBOUT
23 ....N FBI,FBMOD
24 ....F FBI=2:1 S FBMOD=$P($P(FBDATA,U,2),",",FBI) Q:FBMOD="" D Q:FBOUT
25 .....I $Y+7>IOSL D PAGE Q:FBOUT W !," (continued)"
26 .....W !?16,"-",FBMOD
27 ...W !,$P(FBDATA,U,3)
28 ...W ?13,$P(FBDATA,U,4)
29 ...W ?23,$S($P(FBADJ,U,3)]"":$P(FBADJ,U,3),1:$P(FBDATA,U,5))
30 ...W ?33,$J($S($P(FBADJ,U,4)]"":$J($P(FBADJ,U,4),14),1:$P(FBADJ,U,1)),14)
31 ...W ?48,$P(FBADJ,U,5)
32 ...W ?60,$P(FBADJ,U,6)
33 ...I $P(FBADJ,U,7)]"" W !?5,"FPPS Claim ID: ",$P(FBADJ,U,7)," FPPS Line Item: ",$P(FBADJ,U,8)
34 ...S A2=$$EXTRL^FBMRASVR($P(FBDATA,U,4))
35 ...W !?4,"Primary Dx: ",$P(FBDATA,U,10),?40,"S/C Condition? ",$P(FBDATA,U,9) W ?63,"Obl.#: ",$P(FBDATA,U,11)
36 ...D PMNT^FBAACCB2 K A2
37 Q
38HDR ;main header
39 I FBPG>0!FBCRT W @IOF
40 S FBPG=FBPG+1
41 W !?25,$S($G(FBSORT):"VETERAN",1:"VENDOR")," PAYMENT HISTORY"
42 I $G(FB1725R)]"",FB1725R'="A" W " ",$S(FB1725R="M":"for 38 U.S.C. 1725 Claims",1:"excluding 38 U.S.C. 1725 Claims")
43 W !?24,$E(FBDASH,1,24),?71,"Page: ",FBPG,!
44 W:FBSORT "Patient: ",FBPNAME,?41,"Patient ID: ",FBPID W:'FBSORT "Vendor: ",FBVNAME,?41,"Vendor ID: ",FBVID
45 ;W ?71,"Page: ",FBPG
46 W !?(IOM-(13+$L(FBPROG(+FBPI)))/2),"FEE PROGRAM: ",FBPROG(+FBPI)
47 W !,?3,"('*' Reimb. to Patient '+' Cancel. Activity '#' Voided Payment)"
48 W !,?3,"(paid symbol: 'R' RBRVS 'F' 75th percentile 'C' contract 'M' Mill Bill"
49 W !,?3," 'U' U&C)"
50 W !,?1,"Svc Date",?11,"CPT-MOD ",?21,"Rev Code",?31,"Units Paid",?43,"Batch No.",?54,"Inv No.",?64,"Voucher Date"
51 W !,"Amt Claimed",?13,"Amt Paid",?23,"Adj Code",?36,"Adj Amounts",?48,"Remit Remark",?61,"Patient Account No",!,FBDASH
52 Q
53SH ;subheader - vendor if fbsort; patient if 'fbsort, prints when name changed
54 I ($Y+8)>IOSL D:FBCRT CR Q:FBOUT D HDR
55 I FBSORT W !!,"Vendor: ",$P(FBVI,";"),?41,"Vendor ID: ",$P(FBVI,";",2)
56 I 'FBSORT W !!,"Patient: ",$P(FBPT,";"),?41,"Patient ID: ",$$SSNL4^FBAAUTL($$SSN^FBAAUTL($P(FBPT,";",2)))
57 Q
58SH1 S FBPAT=$P(FBPT,";") I $D(^TMP($J,"FBTR",FBPAT)) S FBTRCK=1 D TRAV^FBPAY671
59 Q
60CR ;read for display
61 S DIR(0)="E" W ! D ^DIR K DIR S:$D(DUOUT)!($D(DTOUT)) FBOUT=1
62 Q
63PAGE ;new page
64 I FBCRT D CR Q:FBOUT
65 D HDR,SH
66 Q
67EFBCK(FBCKIN) ;extract check information from ^TMP
68 I $G(FBCKIN)']"" S (FBCK,FBCKDT,FBCANDT,FBCANR,FBCAN,FBDIS,FBCKINT)="" Q
69 S U="^",FBCK=$P(FBCKIN,U,2),FBCKDT=$P(FBCKIN,U,3),FBCANDT=$P(FBCKIN,U,4),FBCANR=$P(FBCKIN,U,5),FBCAN=$P(FBCKIN,U,6),FBDIS=$P(FBCKIN,U,7),FBCKINT=$P(FBCKIN,U,8)
70 K FBCKIN
71 Q
72 ;
73EN ;entry from fbpay67 to set '*' if ancillary payment is
74 ;a reimbursement. returns FBRP=to '*' or " "
75 ;'Y' passed in equal to zero node of 162.03 look at $P(Y,U,20)
76 ;
77 S FBR=$P($G(Y),U,20),FBR=$S(FBR="R":"*",1:" ")
78 Q
Note: See TracBrowser for help on using the repository browser.