VistA-FOIAVistA/r/FEE_BASIS-FB/FBCHPSA1.m

42 lines
2.1 KiB
Mathematica

FBCHPSA1 ;AISC/DMK-PSA OUTPUT CONTINUED ; 18JUN90
;;3.5;FEE BASIS;;JAN 30, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
RX ;
D HED^FBCHPSA K ^TMP("FBPSA",$J)
I FBPSA>0 F FBI=FBBEG-.1:0 S FBI=$O(^FBAA(162.1,"AI",FBPSA,FBI)) Q:FBI'>0!(FBI>FBEND)!(FBAAOUT) D MORE
I FBPSA=0 F FBPSA=0:0 S FBPSA=$O(^FBAA(162.1,"AI",FBPSA)) Q:FBPSA'>0!(FBAAOUT) F FBI=FBBEG-.1:0 S FBI=$O(^FBAA(162.1,"AI",FBPSA,FBI)) Q:FBI'>0!(FBI>FBEND)!(FBAAOUT) D MORE
Q:FBAAOUT
I $D(^TMP("FBPSA",$J)) D HED1^FBCHPSA F I=0:0 S I=$O(^TMP("FBPSA",$J,I)) Q:I'>0 S FBSTA=$S($D(^DIC(4,I,0)):$P(^(0),"^"),1:"Unknown") W !,?2,FBSTA,?44,"$ ",$P(^TMP("FBPSA",$J,I),"^")
I '$D(^TMP("FBPSA",$J)) D NONE
D HANG^FBCHPSA
Q
MORE F FBK=0:0 S FBK=$O(^FBAA(162.1,"AI",FBPSA,FBI,FBK)) Q:FBK'>0!(FBAAOUT) F FBL=0:0 S FBL=$O(^FBAA(162.1,"AI",FBPSA,FBI,FBK,FBL)) Q:FBL'>0!(FBAAOUT) I $D(^FBAA(162.1,FBK,"RX",FBL,0)) S FBI(0)=^(0),FBK(0)=^(2) D WRT
Q
WRT S DFN=$P(FBI(0),"^",5) D 4^VADPT S FBNAME=VADM(1),FBCOUNTY=$P(VAPA(7),"^",2),FBINV=FBK,FBAMTPD=$P(FBI(0),"^",16),FBPDDT=$P(FBI(0),"^",19),FBPDDT=$$DATX^FBAAUTL(FBPDDT),FBPPSA=$P(FBK(0),"^",5)
S FBOBL=$S($P(FBI(0),"^",18)="":"Unknown",1:$P(FBI(0),"^",18))
S FBSTA=$S($D(^DIC(4,FBPPSA,0)):$P(^(0),"^"),1:"Unknown")
I $Y+4>IOSL D HANG^FBCHPSA Q:FBAAOUT D HED^FBCHPSA
W !,$E(FBNAME,1,30)," -",VA("BID"),?42,FBOBL,?57,FBCOUNTY,!,?4,FBINV,?21,FBAMTPD,?39,FBPDDT,?60,FBSTA,!,Q,!
S:'$D(^TMP("FBPSA",$J,FBPSA)) ^TMP("FBPSA",$J,FBPSA)=0
S ^TMP("FBPSA",$J,FBPSA)=^TMP("FBPSA",$J,FBPSA)+FBAMTPD
S:'$D(^TMP("FBTOT",$J,FBPSA)) ^TMP("FBTOT",$J,FBPSA)=0
S ^TMP("FBTOT",$J,FBPSA)=^TMP("FBTOT",$J,FBPSA)+FBAMTPD
Q
;
PROG ;one/many/all fee programs
; returns FBPROG(ien)=external value
;
N DIC,VAUTSTR,VAUTNI,VAUTVB
S DIC="^FBAA(161.8,",DIC("S")="I $P(^(0),U,3)"
S VAUTSTR="FEE PROGRAM",VAUTNI=2,VAUTVB="FBPROG"
D FIRST^VAUTOMA
I 'FBPROG&('$O(FBPROG(0))) Q
I FBPROG D
. N X S X=0
. F S X=$O(^FBAA(161.8,X)) Q:'X S X(0)=$G(^(X,0)) I $P(X(0),U,3) S FBPROG(X)=$P(X(0),U)
Q
;
NONE ;write no payments found for this program and quit
W !!,"No payments found for this Fee Program.",!
Q