Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCAGST

PRCAGST.m

Go to the documentation of this file.
PRCAGST ;WASH-ISC@ALTOONA,PA/CMS-Print Patient Statement ;12/12/96  9:39 AM
V ;;4.5;Accounts Receivable;**34,181,190,249,405,406**;Mar 20, 1995;Build 5
 ;;Per VHA Directive 10-93-142, this routine should not be modified.
 ;ENTRY WITH DEBTOR PRINT STATEMENT
EN(DEB,TBAL,PDAT,PBAL,LDT) ;
 NEW ADD,DA,LN,NAM,PAGE,SSN,X,X1,X2,Y,DEBT,RCDFN
 I '$D(SITE) D SITE^PRCAGU
 S RCDFN=+$P(^RCD(340,+DEB,0),U)     ;PRCA*4.5*405 Get the DFN of the Debtor
 S SSN=$$SSN^RCFN01(DEB),SSN=$S(SSN=-1:"XXXXXXXXX",1:SSN)
 S $P(DEBT,U,2)=$$NAM^RCFN01(DEB)    ;PRCA*4.5*406  Add Debtor name for Acct No Building
 S ADD=$$SADD^RCFN01(8) I ADD="" S ADD=$$SADD^RCFN01(1)
 S X=0 F Y=1:1:3 I $P(ADD,U,Y)]"" S X=X+1 S ADD(X)=$P(ADD,U,Y)
 S X=X+1,ADD(X)=$P(ADD,U,4)_", "_$P(ADD,U,5)_"  "_$P(ADD,U,6)
 S X=X+1,ADD(X)=$P(ADD,U,7)
 W @IOF
 W !!,"Department of Veterans Affairs",?35,"Acct No.: ",$$ACCT^PRCAAPR1(RCDFN) ;PRCA*4.5*405 Replace SSN with Account Number
 W !,$G(ADD(1))
 S Y=$$FPS^RCAMFN01($S($G(LDT)>0:$E(LDT,1,5),1:$E(DT,1,5))_$TR($J($$PST^RCAMFN01(DEB),2)," ",0),$S(+$E($G(LDT),6,7)>$$STD^RCCPCFN:2,1:1)) D DD^%DT
 W !,$G(ADD(2)),?50 I TBAL>0 W "Due: UPON RECEIPT"
 W !,$G(ADD(3)),?50,$S(TBAL>0:"Amount Due: $"_$J(TBAL,0,2),1:"NO AMOUNT DUE")
 W !,$G(ADD(4)),?50,$S(TBAL'>0:"*THIS IS NOT A BILL*",1:"Amount Paid: _____________")
 W !,$G(ADD(5)),?50,"Today's Date: " S Y=DT D DD^%DT W Y
 I TBAL'>0 D MES G LB
 W !!,?2,"Please Make your Check or Money Order payable to the ""Department of Veterans"
 W !,?2,"Affairs"" and send payment to the attention of the Agent Cashier at the above"
 W !,?2,"address.  If you have any questions regarding this statement, please call"
 W !,?2,"1-866-400-1238.",!!!
LB K ADD S NAM=$$NAM^RCFN01(DEB)
 W !,?7,NAM
 S ADD=$$DADD^RCAMADD(DEB,1) ; Get debtor address, confidential if applicable
 S X=0 F Y=1:1:3 I $P(ADD,U,Y)]"" S X=X+1 S ADD(X)=$P(ADD,U,Y)
 S X=X+1,ADD(X)=$P(ADD,U,4)_", "_$P(ADD,U,5)_"  "_$P(ADD,U,6)
 F X=0:0 S X=$O(ADD(X)) Q:'X  W !,?7,$E(ADD(X),1,40) I X=1 W ?50 X $G(SITE("SCAN"))
 W !
 I $G(SITE("COM1"))'="" W !,?2,SITE("COM1")
 I $$GMT(DEB) W !,?2,"REDUCTION OF INPATIENT COPAYMENT DUE TO GEOGRAPHIC MEANS TEST STATUS"
 W !! I TBAL>0 W !,?10,"Please Detach and Return Top Portion with Payment"
 S Y="",$P(Y,"=",80)="" W !,Y
 W !,"IMPORTANT: Please read the Notice of Rights accompanying this statement!",!
 D ^PRCAGST1
 Q
MES ;text for no amount due
 W !!,?2,"This statement is being sent to you to provide you with information"
 W !,?2,"concerning transactions affecting your account. If a prepayment offset"
 W !,?2,"a bill or you have made one or more payments or charges were removed,"
 W !,?2,"from your account, you are being sent this statement to confirm these actions.",!!
 Q
 ;
 ; Detect GMT-related status for the statement (fetch all patient's bills)
 ; Input: Temporary global ^TMP("PRCAGT",$J,PRDEB)
 ; Output: 1 - 'Yes', 0 - 'No'
GMT(PRDEB) N PRDAT,PRBN,PRGMT
 S PRGMT=0 ; Default
 I $G(PRDEB)'="" S PRDAT=0 F  S PRDAT=$O(^TMP("PRCAGT",$J,PRDEB,PRDAT)) Q:'PRDAT  D  Q:PRGMT
 . S PRBN=0 F  S PRBN=$O(^TMP("PRCAGT",$J,PRDEB,PRDAT,PRBN)) Q:'PRBN  D  Q:PRGMT
 .. I $$ISGMTBIL^IBAGMT($P($G(^PRCA(430,PRBN,0)),U,1)) S PRGMT=1
 Q PRGMT