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

41 lines
3.0 KiB
Mathematica

PRCAPRO ;SF-ISC/YJK-PROFILE OF ACCOUNTS RECEIVABLE ;10/17/95 2:02 PM
V ;;4.5;Accounts Receivable;**2,21,125,147,198**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
;PRINT THE PROFILE OF A/R CALLING THE ROUTINES CREATED BY PRINT TEMPLATE
INIT K %ZIS,IOP,DXS S PRCABN=""
EN ;
N DPTNOFZY,DPTNOFZK S (DPTNOFZY,DPTNOFZK)=1
S DIC("S")="S Z0=$S($D(^PRCA(430.3,+$P(^(0),U,8),0)):$P(^(0),U,3),1:0) I (Z0<200)!(Z0=240)",DIC="^PRCA(430,",DIC(0)="AEMQZ",D="B^C^D^E" D MIX^DIC1 K DIC G:Y<0 END S (PRCABN,D0)=+Y
G:$P(^PRCA(430,D0,0),U,8)="" END
I $P(^PRCA(430.3,+$P(^PRCA(430,D0,0),U,8),0),U,3)=104 W *7,!,"This is a New Bill. You should audit this bill to see the profile. ",! G EN
I $P(^PRCA(430.3,+$P(^PRCA(430,D0,0),U,8),0),U,3)=101 W *7,!,"This is an Incomplete Bill. You should edit this bill to see the profile.",! G EN
S %ZIS="Q" D ^%ZIS Q:POP S IOM=80,PRCAIO=IO,PRCAIO(0)=IO(0)
I $D(IO("Q")) K IO("Q") S ZTRTN="PROC^PRCAPRO",ZTSAVE("PRCAIO(0)")=PRCAIO(0),ZTSAVE("D0")=PRCABN,ZTSAVE("PRCABN")=PRCABN,ZTSAVE("PRCAIO")=PRCAIO,ZTDESC="Profile of Accounts Receivable" D ^%ZTLOAD,CLOSE G EN
U IO D PROC,CLOSE G EN
CLOSE D ^%ZISC D END Q
PROC ;===============SUBROUTINE==========================================
S PRCAGL=^PRCA(430,D0,0) Q:+$P(PRCAGL,U,2)'>0 S PRCAT=$P(^PRCA(430.2,$P(PRCAGL,U,2),0),U,6) S:$P(PRCAGL,U,2)=$O(^PRCA(430.2,"AC",33,0)) PRBN=D0
W:IO=IO(0) @IOF
K DXS,^UTILITY($J,"W") D @$S(PRCAT="C":"^PRCATP2",PRCAT="P":"^PRCATP1","OV"[PRCAT:"^PRCATP3",PRCAT="T":"^PRCATP5",1:"^PRCATP4")
I +$G(PRBN),'$D(PRCA("HALT")) D DISP^PRCARFD(PRBN)
W !! K PRBN,PRCAIO,ZTSAVE,ZTDTH,ZTRTN,%ZIS,IOP,DIW,DIWL,DIWR Q
END K PRCAIO,PRCABN,PRCAGL,PRCAT Q
TRANSPR ;TRANSACTION PROFILE
EN1 N DPTNOFZY,DPTNOFZK S (DPTNOFZY,DPTNOFZK)=1
K PRCAIO W ! S DIC="^PRCA(433,",DIC(0)="AEQM",DIC("A")="ENTER AR TRANSACTION NO. OR BILL NO.: " D ^DIC G:Y<0 EXIT S PRCADA=+Y
S PRCA("MESS")="Do you want to queue this output " D QUE^PRCAQUE G:'$D(PRCAQUE) EXIT S IOP=PRCA("DEV"),IOM=80,PRCAIO=IO,PRCAIO(0)=IO(0)
I IO=IO(0) D TR,CLOSE G EN1
I PRCA("DEV")["Q" S ZTRTN="TR^PRCAPRO",ZTSAVE("PRCATYP")="",ZTSAVE("PRCADA")=PRCADA,ZTSAVE("PRCAIO(0)")=PRCAIO(0),ZTSAVE("PRCAIO")=PRCAIO,ZTDESC="Transaction Profile"
I D ^%ZTLOAD,CLOSE W:(IOM-$X)<20 ! W " <REQUEST QUEUED>",*7,! D KILLV G EN1
U IO D TR,CLOSE K %ZIS,IOP,PRCAIO G EN1
TR W:$D(IOF)&($E(IOST,1,2)="C-") @IOF S Z="TRANSACTION PROFILE",Z1=(IOM/2)-($L(Z)/2) W !,?Z1,Z,! F I=1:1:78 W "="
K Z,Z1 W ! S D0=PRCADA K DXS D ^PRCATR3 K DXS S X=PRCADA D ENF^IBOLK
S PRCABN=$P($$EN^PRCAFN1(PRCADA),"^",2),CAT=+$$CAT^PRCAFN1(+PRCABN)
I CAT=24 D STMT^IBRFN1(PRCADA) D:$D(^TMP("IBRFN1",$J))
.S Z=0 F S Z=$O(^TMP("IBRFN1",$J,Z)) Q:'Z S X=^(Z) D
..I $P($G(^PRCA(430,+PRCABN,0)),"^",16)=4 W !,"Visit date: ",$$FMTE^XLFDT($P(X,"^",2)) Q
..W !,"Admission date: ",$$FMTE^XLFDT($P(X,"^",2)),?30,"Discharge date: ",$$FMTE^XLFDT($P(X,"^",5))
D KILLV Q
KILLV K DIR,DIRUT,DIROUT,DUOUT,DTOUT,PRCABN,PRCATYP,DIC,%ZIS,IOP,DA,DD,E,ZTDTH,ZTRTN,ZTSAVE,PRCA,PRCADA,PRCAQUE,DXS,^TMP("IBRFN1") Q
EXIT D KILLV Q