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

PRCAACC.m

Go to the documentation of this file.
  1. PRCAACC ;WASH-ISC@ALTOONA,PA/CMS-AR ACCRUAL TOTALS ;10/19/10 1:36pm
  1. ;;4.5;Accounts Receivable;**60,74,90,101,157,203,220,273,310,338**;Mar 20, 1995;Build 69
  1. ;Per VA Directive 6402, this routine should not be modified.
  1. NEW PRCAQUE,PRCADEV,PRCA,ZTSK
  1. S PRCA("MESS")="Do you wish to queue this report" D QUE^PRCAQUE G:'$D(PRCAQUE) Q
  1. I $D(IO("Q")) S ZTRTN="DQ^PRCAACC",ZTDESC="AR Accrual Totals" D ^%ZTLOAD G Q
  1. DQ ;
  1. U IO
  1. NEW BILLN,COM,TOT,STAT,X,Y
  1. S BILLN=0
  1. D COM G:$O(COM(""))="" RPT
  1. F STAT=42,16 F S BILLN=$O(^PRCA(430,"AC",STAT,BILLN)) Q:'BILLN I $$ACCK(BILLN) D
  1. .S X=(","_$P(^PRCA(430,BILLN,0),"^",2)_",")
  1. .S TOT(X)=$G(TOT(X))+$G(^PRCA(430,BILLN,7))
  1. .QUIT
  1. RPT D NOW^%DTC W @IOF,!!,?23,"Accrual Totals Report",!?20,"As of: " S Y=% X ^DD("DD") W Y,!
  1. S X="",$P(X,"=",80)="" W X
  1. W:$O(COM(""))="" !!,"WARNING: Accruals are *NOT* set-up correctly.",!,"No RX accrual common numbering series are set-up in AR Bill Number File!",!!
  1. S TOT=$G(TOT(",22,"))+$G(TOT(",23,")) I TOT W !!!,"RX CO-PAYMENT Accrual Amount: $",$FN(TOT,",",2)
  1. I $G(TOT(",18,"))>0 W !!!,"C (MEANS TEST) Accrual Amount: $",$FN(TOT(",18,"),",",2)
  1. W !!!!,"Includes Common Numbering Series:",! S COM="" F S COM=$O(COM(COM)) Q:COM="" W !,COM,?20,COM(COM)
  1. Q D ^%ZISC S IOP=IO(0) D ^%ZIS K IOP,IO("Q") Q
  1. ACCK(BN) ;Check BILLN to see if Accrual
  1. N ACC,ACTDATE,CAT,FUND,DB
  1. S CAT=+$P(^PRCA(430,BN,0),"^",2)
  1. ; field 12, ACCRUED ? where 0=no 1=yes, 2=could be either
  1. S ACC=+$P($G(^PRCA(430.2,CAT,0)),"^",9)
  1. ; it could be either accrued or non-accrued
  1. I ACC=2 D
  1. . S FUND=$P($G(^PRCA(430,BN,11)),"^",17)
  1. . S ACC=$S(FUND=5014:1,FUND=2431:1,1:0)
  1. . I $E(FUND,1,4)=5287 S ACC=$$PTACCT(FUND)
  1. . ; special case with Workman's Comp
  1. . I ACC=0,CAT=6,FUND="" D
  1. . . S DB=$P($G(^RCD(340,+$P($G(^PRCA(430,BN,0)),U,9),0)),U)
  1. . . I DB[";DPT"!($P($G(^PRCA(430,BN,0)),U,7)'="") S ACC=1
  1. ;
  1. ; public law states that bills in the category ineligible (1),
  1. ; emerg/human (2), torts (10), or medicare (21) which are older
  1. ; than oct 1, 1992 should be treated as non-accrued.
  1. I CAT=1!(CAT=2)!(CAT=10)!(CAT=21) D
  1. . S ACTDATE=$P($G(^PRCA(430,BN,6)),"^",21) I 'ACTDATE S ACTDATE=DT
  1. . I ACTDATE<2921001 S ACC=0
  1. . ;
  1. . ; patch157 changes ineligibles. an ineligible created before
  1. . ; oct 1, 1992 or after sep 30, 2000 will be non-accrued.
  1. . ; otherwise it will be accrued.
  1. . I CAT=1,ACTDATE>3000930 S ACC=0
  1. ;
  1. Q ACC
  1. COM ;Find Accrual common numbering series
  1. S COM=0
  1. F S COM=$O(^PRCA(430.4,COM)) Q:'COM I $P(^PRCA(430.4,COM,0),"^",6) S COM($P(^PRCA(430.4,COM,0),"^"))=$P($G(^DIC(49,$P(^(0),"^",5),0)),"^",1)
  1. Q
  1. PTACCT(FUND) ;Determines whether Point Accounts are accrued
  1. ;returns 1 for accrued funds 528701,528702,528703,528704,528709,528711
  1. ;returns 0 for any other fund
  1. ;PRCA*4.5*310/DRF Added 528713 to accrued funds
  1. ;PRCA*4.5*338/OB Added 528714 to accrued funds
  1. I FUND'[5287 Q 0
  1. S X=$E(FUND,5,6),X=$S(X="09"!(X="11")!(X="13")!(X="14"):1,X<"05":1,1:0)
  1. Q X
  1. ADDPTEDT() ;Effective date of additional point accounts
  1. ; (528705 - 528708 and 528710)
  1. ;Effective date of switch from 4032 to 528709
  1. Q 3040928