source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBCHVH.m@ 1574

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

initial load of WorldVistAEHR

File size: 3.7 KB
RevLine 
[613]1FBCHVH ;AISC/DMK-VENDOR PAYMENT HISTORY ;7/17/2003
2 ;;3.5;FEE BASIS;**55,61**;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4GETVEN K FBAANQ D GETVEN^FBAAUTL1 G END:IFN']""
5 D DATE^FBAAUTL G:FBPOP GETVEN S ZZ=9999999.9999,FBBEG=ZZ-ENDDATE,FBEND=ZZ-BEGDATE
6 I '$D(^FBAAI("AF",IFN)) W !,*7,"No invoices on line for this vendor." G GETVEN
7 S VAR="IFN^FBBEG^FBEND^BEGDATE^ENDDATE"_$S($D(FBPROG):"^FBPROG",1:""),VAL=IFN_"^"_FBBEG_"^"_FBEND_"^"_BEGDATE_"^"_ENDDATE_$S($D(FBPROG):"^"_FBPROG,1:""),PGM="START^FBCHVH" D ZIS^FBAAUTL G:FBPOP END S:IO=IO(0) FBAANQ=1
8START S:'$D(FBPROG) FBPROG=6 S FBHEAD="VENDOR",Q="",$P(Q,"=",80)="=",FBAAOUT=0 U IO D GETDAT S:$E(IOST,1,2)'["C-" FBPG=1 D HEDC
9 F FBM=FBBEG-.1:0 S FBM=$O(^FBAAI("AF",IFN,FBM)) Q:FBM'>0!(FBM>FBEND) F FBI=0:0 S FBI=$O(^FBAAI("AF",IFN,FBM,FBI)) Q:FBI'>0!(FBAAOUT) I $D(^FBAAI(FBI,0)),$P(^(0),"^",12)=FBPROG,'$D(^("FBREJ")) D GETINV
10 G:$D(FBAANQ) GETVEN
11END K DA,DFN,BEGDATE,ENDDATE,FBBEG,FBEND,DIC,FBAANQ,FBAAOUT,FBDX,FBI,FBIN,FBPROC,FBVEN,FBVID,IFN,J,K,L,PGM,Q,VADM,VAERR,VAL,VAR,X,Y,VA,ZZ,FBM,FBHEAD,FBPROG,FBPG,FBVINDT
12 D CLOSE^FBAAUTL Q
13GETINV ;
14 N FBADJLA,FBADJLR,FBCDAYS,FBCSID,FBFPPSC,FBFPPSL,FBRRMKL,FBY2,FBY3
15 S FBIN=^FBAAI(FBI,0)
16 S FBY2=$G(^FBAAI(FBI,2))
17 S FBY3=$G(^FBAAI(FBI,3))
18 F J=1,2,3,4,6,7,8,9,10,11,13,14 S FBIN(J)=$P(FBIN,"^",J)
19 S FBVINDT=$P(FBY2,"^",2) D FBCKI^FBAACCB1(FBI)
20 S FBVEN=$S($D(^FBAAV(+FBIN(3),0)):$P(^(0),"^",1),1:"") I FBVEN]"" S FBVID=$P(^(0),"^",2)
21 S DFN=FBIN(4) Q:'DFN D DEM^VADPT
22 S Y=FBIN(2) D CDAT S FBIN(2)=Y
23 S Y=FBIN(6) D CDAT S FBIN(6)=Y,Y=FBIN(7) D CDAT S FBIN(7)=Y
24 S FBCDAYS=$P(FBY2,U,10) ; covered days
25 S FBCSID=$P(FBY2,U,11) ; patient control number
26 S FBFPPSC=$P(FBY3,U) ; fpps claim id
27 S FBFPPSL=$P(FBY3,U,2) ; fpps line item
28 S FBX=$$ADJLRA^FBCHFA(FBI_",")
29 S FBADJLR=$P(FBX,U)
30 S FBADJLA=$P(FBX,U,2)
31 S FBRRMKL=$$RRL^FBCHFR(FBI_",")
32WRT I $Y+6>IOSL D HANG^FBAAUTL1:$E(IOST,1,2)["C-" Q:FBAAOUT D HEDC
33 W !,$S('$D(FBIN(13)):"",FBIN(13)="R":"*",1:""),$S($G(FBCAN)]"":"+",1:"")
34 W VADM(1)_" "_$P(VADM(2),"^",2),?48,FBCSID
35 W !,?4,FBVEN,?45,FBVID,?62,FBIN(1)
36 W !,$S(FBIN(13)["R":"*",1:""),$S(FBIN(14)]"":"#",1:"")
37 W ?4,FBFPPSC,?18,FBFPPSL,?35,FBIN(2),?46,$$DATX^FBAAUTL(FBVINDT),?57,FBIN(6),?68,FBIN(7)
38 W !?4,$J(FBIN(8),1,2),?17,$J(FBIN(9),1,2),?29,FBCDAYS
39 ; write adjustment reasons, if null then write suspend code
40 W ?39,$S(FBADJLR]"":FBADJLR,1:FBIN(11))
41 ; write adjustment amounts, if null then write amount suspended
42 W ?49,$S(FBADJLA]"":FBADJLA,1:$J(FBIN(10),1,2))
43 W ?64,FBRRMKL
44 W !
45 I $D(^FBAAI(FBI,"DX")) S FBDX=^("DX") F K=1:1:5 D WRTDX
46 I $D(^FBAAI(FBI,"PROC")) S FBPROC=^("PROC") W ! F L=1:1:5 D WRTPC
47 N A2 S A2=FBIN(9) D PMNT^FBAACCB2
48 Q
49WRTDX I $P(FBDX,"^",K)]"" W ?4,"Dx: ",$$ICD9^FBCSV1(+$P(FBDX,"^",K),$P($G(FBIN),"^",6))," " Q
50 Q
51WRTPC I $P(FBPROC,"^",L)]"" W ?4,"Proc: ",$$ICD0^FBCSV1(+$P(FBPROC,"^",L),$P($G(FBIN),"^",6))," " Q
52 Q
53HEDC I $D(FBHEAD) W:'$G(FBPG) @IOF K:$G(FBPG) FBPG W ?25,FBHEAD_" PAYMENT HISTORY",!,?24,$E(Q,1,24),!?48,"Date Range: ",BEGDATE_" to "_ENDDATE
54 I '$D(FBHEAD) W:'$G(FBPG) @IOF K:$G(FBPG) FBPG W !?32,"INVOICE DISPLAY",!,?31,$E(Q,1,17),!
55 W !,"Veteran's Name",?48,"Patient Control Number"
56 W !,"('*'Reimbursement to Veteran '+' Cancellation Activity) '#' Voided Payment)"
57 W !,?4,"Vendor Name",?45,"Vendor ID",?59,"Invoice #"
58 ;W !,?3,"Fr Date",?14,"To Date Claimed Paid",?41,"Sus Code",?59,"Dt. Rec.",?69,"Inv. Date"
59 W !,?4,"FPPS Claim ID",?18,"FPPS Line Item",?35,"Date Rec.",?46,"Inv. Date",?57,"Fr Date",?68,"To Date"
60 W !,?4,"Amt Claimed",?17,"Amt Paid",?29,"Cov.Days",?39,"Adj Code",?49,"Adj Amount",?64,"Remit Remark"
61 W !,Q,!
62 Q
63CDAT S Y=$E(Y,4,5)_"/"_$S($E(Y,6,7)="00":$E(Y,2,3),1:$E(Y,6,7)_"/"_$E(Y,2,3)) Q
64GETDAT S Y=BEGDATE D PDF^FBAAUTL S BEGDATE=Y,Y=ENDDATE D PDF^FBAAUTL S ENDDATE=Y
65 Q
Note: See TracBrowser for help on using the repository browser.