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