source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBAAVLU.m@ 1361

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

initial load of WorldVistAEHR

File size: 3.7 KB
RevLine 
[613]1FBAAVLU ;AISC/DMK-LOOK UP VENDOR FOR TIME FRAME ;8/10/2003
2 ;;3.5;FEE BASIS;**4,61**;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 D DT^DICRW
5RDV S FBAAOUT=0 K FBAANQ W !! S DIC="^FBAAV(",DIC(0)="AEQM",DIC("A")="Select Medical Vendor: ",DIC("S")="I $P(^(0),""^"",7)'=3" D ^DIC K DIC("S"),DIC("A") G Q:X="^"!(X=""),RDV:Y<0 S DA=+Y
6 D DATE^FBAAUTL G:FBPOP RDV S ZZ=9999999.9999,BEG=ZZ-ENDDATE,END=ZZ-BEGDATE
7 S VAR="DA^BEG^END",VAL=DA_"^"_BEG_"^"_END,PGM="START^FBAAVLU" D ZIS^FBAAUTL G:FBPOP Q S:IO=IO(0) FBAANQ=1
8START S Q="",$P(Q,"-",80)="-",HNAM="",FBDEL=$S($P($G(^FBAAV(DA,"ADEL")),"^")="Y":1,1:0) U IO W:$E(IOST,1,2)["C-" @IOF D HED
9 F J=0:0 S J=$O(^FBAAC("AB",DA,J)) Q:J'>0!(FBAAOUT) F FBK=BEG-1:0 S FBK=$O(^FBAAC(J,DA,"AD",FBK)) Q:FBK>END!(FBK'>0)!(FBAAOUT) S K=DA D MORE
10 G:$D(FBAANQ) RDV
11Q D CLOSE^FBAAUTL K DA,%DT,M,HNAM,J,BEG,BEGDATE,V,DIC,END,ENDDATE,A1,A2,B,B1,B2,PI,T,FBAACPT,FBAADT,FBAAPD,FBIN,FBAANQ,FBAAOUT,K,L,PTNAM,ZS,PGM,Q,VAL,VAR,X,Y,ZZ,FBDEL,FBMOD,FBMODLE Q
12MORE F L=0:0 S L=$O(^FBAAC(J,DA,"AD",FBK,L)) Q:L'>0!(FBAAOUT) F M=0:0 S M=$O(^FBAAC(J,1,DA,1,L,1,M)) Q:M'>0!(FBAAOUT) S B=^(M,0) I $P(B,"^",6)]"" S T=$P(B,"^",5),FBAAPD=$P(B,"^",14),ZS=$P(B,"^",20),V=$P(B,"^",21) D
13 .D FBCKO^FBAACCB2(J,K,L,M),WRT
14 Q
15WRT ;
16 N FBAARCE,FBADJLA,FBADJLR,FBCSID,FBFPPSC,FBFPPSL,FBRRMKL,FBUNITS
17 N FBX,FBY2,FBY3,TAMT
18 I $E(IOST,1,2)["C-",$Y+4>IOSL S DIR(0)="E" D ^DIR K DIR S:'Y FBAAOUT=1 Q:FBAAOUT W @IOF D HED
19 E I $Y+4>IOSL W @IOF D HED
20 S FBAADT=$P(^FBAAC(J,1,DA,1,L,0),"^",1),FBAADT=$E(FBAADT,4,5)_"/"_$E(FBAADT,6,7)_"/"_$E(FBAADT,2,3),B1=$P(B,"^",8),B2=$S(B1="":"",$D(^FBAA(161.7,B1,0)):$P(^FBAA(161.7,B1,0),"^",1),1:""),PTNAM=$S($D(^DPT(J,0)):$P(^DPT(J,0),"^"),1:"")
21 S FBAAPD=$S(FBAAPD]"":$E(FBAAPD,4,5)_"/"_$E(FBAAPD,6,7)_"/"_$E(FBAAPD,2,3),1:"NOT PAID")
22 S A1=$P(B,"^",2)+.0001,A2=$P(B,"^",3)+.0001,A1=$P(A1,".",1)_"."_$E($P(A1,".",2),1,2),A2=$P(A2,".",1)_"."_$E($P(A2,".",2),1,2),FBIN=$P(B,"^",16)
23 S FBAACPT=$$CPT^FBAAUTL4($P(B,"^",1))
24 S FBMODLE=$$MODL^FBAAUTL4("^FBAAC("_J_",1,"_K_",1,"_L_",1,"_M_",""M"")","E")
25 S FBY3=$G(^FBAAC(J,1,K,1,L,1,M,3))
26 S FBFPPSC=$P(FBY3,U)
27 S FBFPPSL=$P(FBY3,U,2)
28 S FBX=$$ADJLRA^FBAAFA(M_","_L_","_K_","_J_",")
29 S FBADJLR=$P(FBX,U)
30 S FBADJLA=$P(FBX,U,2)
31 S TAMT=$FN($P(B,"^",4),"",2)
32 S FBAARCE=$$GET1^DIQ(162.03,M_","_L_","_K_","_J_",",48)
33 S FBY2=$G(^FBAAC(J,1,K,1,L,1,M,2))
34 S FBUNITS=$P(FBY2,U,14)
35 S FBCSID=$P(FBY2,U,16)
36 S FBRRMKL=$$RRL^FBAAFR(M_","_L_","_K_","_J_",")
37 W:PTNAM'=HNAM !,PTNAM
38 W !,$S(ZS="R":"*",1:""),$S(V="VP":"#",1:""),$S($G(FBCAN)]"":"+",1:""),?2,FBAADT,?12,FBAACPT_$S($G(FBMODLE)]"":"-"_$P(FBMODLE,","),1:""),?22,FBAARCE,?31,FBUNITS,?38,FBCSID,?60,FBIN,?71,B2
39 I $P($G(FBMODLE),",",2)]"" D Q:FBAAOUT
40 . N FBI
41 . F FBI=2:1 S FBMOD=$P(FBMODLE,",",FBI) Q:FBMOD="" D Q:FBAAOUT
42 . . I $Y+4>IOSL D Q:FBAAOUT
43 . . . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I 'Y S FBAAOUT=1 Q
44 . . . W @IOF D HED W !,"(continued)"
45 . . W !,?17,"-",FBMOD
46 W !?4,"$",$J(A1,8),?17,"$",$J(A2,8)
47 ; write adjustment reasons, if null then write suspend code
48 W ?30,$S(FBADJLR]"":FBADJLR,1:T)
49 ; write adjustment amounts, if null then write amount suspended
50 W ?40,"$",$S(FBADJLA]"":FBADJLA,1:TAMT)
51 W ?56,FBRRMKL,?70,FBAAPD
52 I FBFPPSC]"" W !,?5,"FPPS Claim ID: ",FBFPPSC,?32,"FPPS Line Item: ",FBFPPSL
53 D PMNT^FBAACCB2
54 S HNAM=PTNAM
55 Q
56HED S FBAAOUT=0 W ?26,"** VENDOR LOOK-UP **",!,!,?23,"Vendor: ",$P(^FBAAV(DA,0),"^",1),!,?14,"('*' Reimb. to Patient '+' Cancel. Activity)",!,"PATIENT",?14,"('#' Voided Payment)"
57 W !?2,"SVC DATE",?12,"CPT-MOD",?22,"REV.CODE",?31,"UNITS",?38,"PATIENT ACCOUNT NO.",?60,"INVOICE #",?71,"BATCH #"
58 W !?4,"AMT CLAIMED",?17,"AMT PAID",?30,"ADJ CODE",?40,"ADJ AMOUNT",?56,"REMIT REMARK",?70,"DATE PAID"
59 W !,Q,!
60 Q
Note: See TracBrowser for help on using the repository browser.