PRCAGD ;WASH-ISC@ALTOONA,PA/CMS-Balance Discrepancy Message ;8/11/93  10:08 AM
V ;;4.5;Accounts Receivable;;Mar 20, 1995
 ;;Per VHA Directive 10-93-142, this routine should not be modified.
 ;SEND (DEBTOR,BILL BALANCE,TRAN BAL,PREV BAL,REPRINT FLAG)
EN(DEB,BBAL,TBAL,PBAL,BEG,REP) ;balance discrepancy, transmit mailman message
 N NAM,SSN,XMSUB,XMDUZ,XMTEXT,XMY,X1,X,Y
 S NAM=$$NAM^RCFN01(DEB),SSN=$$SSN^RCFN01(DEB),XMSUB=$E(NAM,1,16)_" ("_$E(NAM)_$E(SSN,6,9)_") Statement Balance Discrepancy",XMDUZ="AR Package",XMTEXT="X1("
 I $D(^XMB(3.8,"B","PRCA ERROR")) S XMY("G.PRCA ERROR")=""
 S Y=DT X ^DD("DD")
 S X1(1)="***** NOTICE: Patient: "_NAM_"   SSN: "_SSN_"   statement was not",X1(2)="generated on "_Y_" because of a discrepancy in the account balances"
 S X1(3)="between the patient statement balance and the Accounts Receivable balance.",X1(4)=""
 S X1(5)="Accounts Receivable (bills) has a balance of:         $ "_$J(BBAL,10,2)
 S X1(6)="Patient Statement (*amount due) has a balance of:     $ "_$J((TBAL+PBAL),10,2)
 S X1(7)="The difference between these two balances is:         $ "_$J((BBAL-(TBAL+PBAL)),10,2),X1(8)=""
 S Y=BEG X ^DD("DD") S X1(9)="*Previous Statement balance  $ "_$J(PBAL,0,2)_$S(Y'=0:"(all activity through "_Y_")",1:"")
 S X1(10)="         + New Transactions  $ "_$J(TBAL,0,2),X1(11)=""
 S X1(12)="",X1(13)="PLEASE REVIEW ACCOUNT, CORRECT THE DISCREPANCY AND PRINT THE PATIENT'S STATEMENT"
 S:$G(REP) X1(14)="",X1(15)="*** ERROR OCCURRED FROM USING THE PRINT PATIENT ***",X1(17)="*** STATEMENT/LETTERS OPTION                    ***"
 S:'$D(XMY) XMY(.5)="" D ^XMD
 Q
REF(DEB,BN,REP) ;Print discrepancy because of unprocessed refund
 N NAM,SSN,XMSUB,XMDUZ,XMTEXT,XMY,X1,X,Y
 S NAM=$$NAM^RCFN01(DEB),SSN=$$SSN^RCFN01(DEB),XMSUB=$E(NAM,1,16)_" ("_$E(NAM)_$E(SSN,6,9)_") Statement Refund Discrepancy",XMDUZ="AR Package",XMTEXT="X1("
 I $D(^XMB(3.8,"B","PRCA ERROR")) S XMY("G.PRCA ERROR")=""
 S X1(1)="***** NOTICE: Patient: "_NAM_"    SSN: "_SSN_"   statement did not"
 S Y=DT X ^DD("DD")
 S X1(2)="print on "_Y_" because the unprocessed prepayment bill "_$P(^PRCA(430,BN,0),U,1)
 S X1(3)="is in the status "_$P(^PRCA(430.3,$P(^PRCA(430,BN,0),U,8),0),U,1)_"!"
 S X1(4)=" "
 S X1(5)="Please complete the process of the prepayment bill then print the statement"
 S X1(6)="using the Print Statements/Letters by Date option."
 S:$G(REP) X1(7)="",X1(8)="*** ERROR OCCURRED FROM USING THE PRINT PATIENT ***",X1(9)="*** STATEMENT/LETTERS OPTION                    ***"
 S:'$D(XMY) XMY(.5)="" D ^XMD
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCAGD   2555     printed  Sep 23, 2025@19:15:39                                                                                                                                                                                                      Page 2
PRCAGD    ;WASH-ISC@ALTOONA,PA/CMS-Balance Discrepancy Message ;8/11/93  10:08 AM
V         ;;4.5;Accounts Receivable;;Mar 20, 1995
 +1       ;;Per VHA Directive 10-93-142, this routine should not be modified.
 +2       ;SEND (DEBTOR,BILL BALANCE,TRAN BAL,PREV BAL,REPRINT FLAG)
EN(DEB,BBAL,TBAL,PBAL,BEG,REP) ;balance discrepancy, transmit mailman message
 +1        NEW NAM,SSN,XMSUB,XMDUZ,XMTEXT,XMY,X1,X,Y
 +2        SET NAM=$$NAM^RCFN01(DEB)
           SET SSN=$$SSN^RCFN01(DEB)
           SET XMSUB=$EXTRACT(NAM,1,16)_" ("_$EXTRACT(NAM)_$EXTRACT(SSN,6,9)_") Statement Balance Discrepancy"
           SET XMDUZ="AR Package"
           SET XMTEXT="X1("
 +3        IF $DATA(^XMB(3.8,"B","PRCA ERROR"))
               SET XMY("G.PRCA ERROR")=""
 +4        SET Y=DT
           XECUTE ^DD("DD")
 +5        SET X1(1)="***** NOTICE: Patient: "_NAM_"   SSN: "_SSN_"   statement was not"
           SET X1(2)="generated on "_Y_" because of a discrepancy in the account balances"
 +6        SET X1(3)="between the patient statement balance and the Accounts Receivable balance."
           SET X1(4)=""
 +7        SET X1(5)="Accounts Receivable (bills) has a balance of:         $ "_$JUSTIFY(BBAL,10,2)
 +8        SET X1(6)="Patient Statement (*amount due) has a balance of:     $ "_$JUSTIFY((TBAL+PBAL),10,2)
 +9        SET X1(7)="The difference between these two balances is:         $ "_$JUSTIFY((BBAL-(TBAL+PBAL)),10,2)
           SET X1(8)=""
 +10       SET Y=BEG
           XECUTE ^DD("DD")
           SET X1(9)="*Previous Statement balance  $ "_$JUSTIFY(PBAL,0,2)_$SELECT(Y'=0:"(all activity through "_Y_")",1:"")
 +11       SET X1(10)="         + New Transactions  $ "_$JUSTIFY(TBAL,0,2)
           SET X1(11)=""
 +12       SET X1(12)=""
           SET X1(13)="PLEASE REVIEW ACCOUNT, CORRECT THE DISCREPANCY AND PRINT THE PATIENT'S STATEMENT"
 +13       if $GET(REP)
               SET X1(14)=""
               SET X1(15)="*** ERROR OCCURRED FROM USING THE PRINT PATIENT ***"
               SET X1(17)="*** STATEMENT/LETTERS OPTION                    ***"
 +14       if '$DATA(XMY)
               SET XMY(.5)=""
           DO ^XMD
 +15       QUIT 
REF(DEB,BN,REP) ;Print discrepancy because of unprocessed refund
 +1        NEW NAM,SSN,XMSUB,XMDUZ,XMTEXT,XMY,X1,X,Y
 +2        SET NAM=$$NAM^RCFN01(DEB)
           SET SSN=$$SSN^RCFN01(DEB)
           SET XMSUB=$EXTRACT(NAM,1,16)_" ("_$EXTRACT(NAM)_$EXTRACT(SSN,6,9)_") Statement Refund Discrepancy"
           SET XMDUZ="AR Package"
           SET XMTEXT="X1("
 +3        IF $DATA(^XMB(3.8,"B","PRCA ERROR"))
               SET XMY("G.PRCA ERROR")=""
 +4        SET X1(1)="***** NOTICE: Patient: "_NAM_"    SSN: "_SSN_"   statement did not"
 +5        SET Y=DT
           XECUTE ^DD("DD")
 +6        SET X1(2)="print on "_Y_" because the unprocessed prepayment bill "_$PIECE(^PRCA(430,BN,0),U,1)
 +7        SET X1(3)="is in the status "_$PIECE(^PRCA(430.3,$PIECE(^PRCA(430,BN,0),U,8),0),U,1)_"!"
 +8        SET X1(4)=" "
 +9        SET X1(5)="Please complete the process of the prepayment bill then print the statement"
 +10       SET X1(6)="using the Print Statements/Letters by Date option."
 +11       if $GET(REP)
               SET X1(7)=""
               SET X1(8)="*** ERROR OCCURRED FROM USING THE PRINT PATIENT ***"
               SET X1(9)="*** STATEMENT/LETTERS OPTION                    ***"
 +12       if '$DATA(XMY)
               SET XMY(.5)=""
           DO ^XMD
 +13       QUIT