VistA-WorldVistAEHR/r/ACCOUNTS_RECEIVABLE-PRCA-PR.../PRCASER.m

33 lines
2.2 KiB
Mathematica

PRCASER ;WASH-ISC@ALTOONA,PA/RGY-Accept bill from billing engine ;2/23/95 2:40 PM
V ;;4.5;Accounts Receivable;**90,153,203,211**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
NEW PRCAX,PRCASV,PRCAEN,PRCASEG
S PRCAX=X,Y=0 F X="SITE","SER","CAT","DEBTOR","FY","AMT","APR","BDT" S Y=Y+1,PRCASV(X)=$P(PRCAX,"^",Y)
L +^RCD(340,PRCASV("DEBTOR"),"PRCASER"):30 I '$T S Y="-1^PRCA004^AR Package 'busy' while trying to add transaction." G Q1
I ",3,4,5,24,25,"[(","_PRCASV("CAT")_",") S PRCASV("CARE")=PRCASV("CAT"),PRCASV("CAT")=18
S PRCASV("FY")=PRCASV("FY")_"^"_PRCASV("AMT")
I '$D(PRCASV("PAT")) S PRCASV("PAT")=PRCASV("DEBTOR")
S X=$O(^RCD(340,"B",PRCASV("DEBTOR"),0)) D:PRCASV("CAT")]""&X CHKAO I $D(PRCASV("ARREC")) D:PRCASV("AMT") TRAN S Y=PRCASV("ARREC")_"^"_PRCASV("ARBIL")_"^"_$S($D(PRCAEN):PRCAEN,1:"") G Q
D ^PRCASVC3 I PRCASV("ARREC")<0,$P(PRCASV("ARREC"),"^",2)]"" S Y=PRCASV("ARREC") G Q
I PRCASV("ARBIL")<0 S Y=PRCASV("ARBIL") G Q
S $P(PRCASV("FY"),"^",2)=0 D REL^PRCASVC S $P(PRCASV("FY"),"^",2)=PRCASV("AMT") I $D(PRCAERR) S Y=PRCAERR G Q
S PRCASEG=$S($D(PRCASV("CARE")):PRCASV("CARE"),$D(PRCASV("CAT")):PRCASV("CAT"),1:0) S:PRCASEG>1 PRCASEG=$P(^PRCA(430.2,PRCASEG,0),"^",3)
S DR="8////^S X="_$O(^PRCA(430.3,"AC",112,0))_";20.1////^S X="_PRCASEG
S DR=DR_";203////^S X="_$$GETFUNDB^RCXFMSUF(PRCASV("ARREC"),1)
I $D(PRCASV("CARE")) S DR=DR_";15.1////^S X="_PRCASV("CARE")
S DA=PRCASV("ARREC"),DIE="^PRCA(430," D ^DIE D:PRCASV("AMT")>0 TRAN
S Y=PRCASV("ARREC")_"^"_PRCASV("ARBIL")_"^"_$S($D(PRCAEN):PRCAEN,1:"")
Q L -^RCD(340,PRCASV("DEBTOR"),"PRCASER")
Q1 S X=PRCAX K PRCAERR Q
CHKAO ;
F Y=0:0 S Y=$O(^PRCA(430,"AS",X,$O(^PRCA(430.3,"AC",112,0)),Y)) Q:'Y D
.I $P(^PRCA(430,Y,0),"^",2)=PRCASV("CAT"),$S(PRCASV("CAT")'=$O(^PRCA(430.2,"AC",24,0)):1,$P(^PRCA(430,Y,0),"^",16)=PRCASV("CARE"):1,1:0) S PRCASV("ARREC")=Y,PRCASV("ARBIL")=$P(^PRCA(430,Y,0),"^")
.QUIT
Q
TRAN ;
NEW PRCABN,PRCAMT,PRCAA2
D SETTR^PRCAUTL S PRCABN=PRCASV("ARREC") D PATTR^PRCAUTL
S PRCA("ADJ")=$O(^PRCA(430.3,"AC",1,0)),DIE="^PRCA(433,",DR="[PRCA FY ADJ2 BATCH]",DA=PRCAEN D ^DIE S PRCAA2=$P(^PRCA(433,PRCAEN,4,0),"^",3) D UPFY^PRCADJ,TRANUP^PRCAUTL,UPPRIN^PRCADJ
D PREPAY^RCBEPAYP(PRCABN,0)
Q