RCCPC1 ;WASH-ISC@ALTOONA,PA/LDB-Setups for CCPC;11/19/96 10:21 AM
V ;;4.5;Accounts Receivable;**34,70**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
EN ;called by RCCPC0
;
XMBGRP ;Setup RCCPC STATEMENTS MAIL GROUP
N DES,X
S DES(1)="CCPC PATIENT STATEMENTS MESSAGES"
S X=$$MG^XMBGRP("RCCPC STATEMENTS",0,.5,1,"",.DES,1)
;
SDAY ;set patient statement day to site statement day
S DEB=0 F S DEB=$O(^RCD(340,"AB","DPT(",DEB)) Q:'DEB I $D(^RCD(340,+DEB,0)) D
.S STDT=$P($G(^RCD(340,+DEB,0)),"^",3) Q:'STDT
.S SSTDT=$P($G(^RC(342,1,0)),"^",11)
.Q:(SSTDT=STDT)
.K ^RCD(340,"AC",STDT,+DEB)
.S $P(^RCD(340,+DEB,0),"^",3)=SSTDT
.S ^RCD(340,"AC",SSTDT,DEB)=""
;
RESET ;Reset statement days for non-patients
S X(1)=$$STDY^RCCPCFN,X=0 F S X=$O(^RCD(340,"AC",X(1),X)) Q:'X D
.K ^RCD(340,"AC",X(1),X)
.S $P(^RCD(340,+X,0),"^",3)=+X(1)
.S ^RCD(340,"AC",+X(1),X)=""
;
DOMAIN ;sets up 349.1 entry pointer to DOMAIN
S DIC="^DIC(4.2,",X="Q-CCP.DOMAIN.EXT",DIC(0)="M" D ^DIC Q:Y<0
S SEG=$O(^RCT(349.1,"B","PS",0)) Q:'SEG
S $P(^RCT(349.1,+SEG,3),"^",2,3)=+Y_"^"_$P(Y,"^",2)
;
DMC ;Find delinquent bill olders than 4/28/94 with no waiver rights
N COM,DA,DFN,DIE,DR,DAT,PRCABN,PRCAEN,RCD,TODAY,TYP,VAEL,XMSUB,XMTEXT,XMY
Q:$P(^RC(342,1,0),"^",13)
S RCD=0 F S RCD=$O(^RCD(340,"AB","DPT(",RCD)) Q:'RCD D
.Q:'$G(^RCD(340,+RCD,0))
.S DAT=$O(^RC(341,"AD",RCD,2,0))
.S DAT=9999999.999999-DAT
.I DAT>2940428 Q
.S DFN=+$G(^RCD(340,+RCD,0)) D ELIG^VADPT
.I 'VAEL(1) Q
.D DEM^VADPT I +$G(VADM(6))!VAERR Q
.I $$ACT^PRCAGT(+RCD,DAT) Q
.D NOW^%DTC S TODAY=$P(%,".")
.S COM="Waiver rights on statement."
.S PRCABN=$O(^PRCA(430,"AS",+RCD,16,0))
.Q:'PRCABN
.I "^18^22^23^"'[("^"_$P(^PRCA(430,+PRCABN,0),"^",2)_"^") S PRCABN=$O(^PRCA(430,"AS",+RCD,16,PRCABN))
.Q:'PRCABN
.D SETTR^PRCAUTL,PATTR^PRCAUTL
.S TYP=$O(^PRCA(430.3,"AC",17,0))
.S DR=".03////^S X="_PRCABN_";3////^S X=0;4////^S X=2;12////^S X=TYP;15////^S X=0;42////^S X=$G(DUZ)"
.S DR=DR_";11////^S X=TODAY;5.02////^S X=COM;5.03////^S X="_$$STD^RCCPCFN
.S DA=PRCAEN,DIE="^PRCA(433,"
.D ^DIE
.D MAIL
S:'$O(^RCT(349,0)) $P(^RC(342,1,0),"^",13)=$$STD^RCCPCFN
I $O(^RCT(349,0)) S X=$P(^RCT(349,$O(^RCT(349,0)),0),"^",9),X=$E(X,1,2)_"/"_$E(X,3,4)_"/"_$E(X,5,8) D ^%DT S $P(^RC(342,1,0),"^",13)=Y
Q
;
MAIL ;Send message
S XMSUB="Patient with no previous waiver rights notice"
S XMDUZ="AR PACKAGE"
S XMY("G.RCCPC STATEMENTS")=""
S XMSG(1)="This patient: "_$$NAM^RCFN01(+RCD)_" "_$$SSN^RCFN01(+RCD)
S XMSG(2)="will receive a statement next statement date with"
S XMSG(3)="WAIVER RIGHTS and a comment on bill "_$P($G(^PRCA(430,+PRCABN,0)),"^")
S XMTEXT="XMSG("
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCCPC1 2753 printed Nov 22, 2024@16:53:19 Page 2
RCCPC1 ;WASH-ISC@ALTOONA,PA/LDB-Setups for CCPC;11/19/96 10:21 AM
V ;;4.5;Accounts Receivable;**34,70**;Mar 20, 1995
+1 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+2 ;
EN ;called by RCCPC0
+1 ;
XMBGRP ;Setup RCCPC STATEMENTS MAIL GROUP
+1 NEW DES,X
+2 SET DES(1)="CCPC PATIENT STATEMENTS MESSAGES"
+3 SET X=$$MG^XMBGRP("RCCPC STATEMENTS",0,.5,1,"",.DES,1)
+4 ;
SDAY ;set patient statement day to site statement day
+1 SET DEB=0
FOR
SET DEB=$ORDER(^RCD(340,"AB","DPT(",DEB))
if 'DEB
QUIT
IF $DATA(^RCD(340,+DEB,0))
Begin DoDot:1
+2 SET STDT=$PIECE($GET(^RCD(340,+DEB,0)),"^",3)
if 'STDT
QUIT
+3 SET SSTDT=$PIECE($GET(^RC(342,1,0)),"^",11)
+4 if (SSTDT=STDT)
QUIT
+5 KILL ^RCD(340,"AC",STDT,+DEB)
+6 SET $PIECE(^RCD(340,+DEB,0),"^",3)=SSTDT
+7 SET ^RCD(340,"AC",SSTDT,DEB)=""
End DoDot:1
+8 ;
RESET ;Reset statement days for non-patients
+1 SET X(1)=$$STDY^RCCPCFN
SET X=0
FOR
SET X=$ORDER(^RCD(340,"AC",X(1),X))
if 'X
QUIT
Begin DoDot:1
+2 KILL ^RCD(340,"AC",X(1),X)
+3 SET $PIECE(^RCD(340,+X,0),"^",3)=+X(1)
+4 SET ^RCD(340,"AC",+X(1),X)=""
End DoDot:1
+5 ;
DOMAIN ;sets up 349.1 entry pointer to DOMAIN
+1 SET DIC="^DIC(4.2,"
SET X="Q-CCP.DOMAIN.EXT"
SET DIC(0)="M"
DO ^DIC
if Y<0
QUIT
+2 SET SEG=$ORDER(^RCT(349.1,"B","PS",0))
if 'SEG
QUIT
+3 SET $PIECE(^RCT(349.1,+SEG,3),"^",2,3)=+Y_"^"_$PIECE(Y,"^",2)
+4 ;
DMC ;Find delinquent bill olders than 4/28/94 with no waiver rights
+1 NEW COM,DA,DFN,DIE,DR,DAT,PRCABN,PRCAEN,RCD,TODAY,TYP,VAEL,XMSUB,XMTEXT,XMY
+2 if $PIECE(^RC(342,1,0),"^",13)
QUIT
+3 SET RCD=0
FOR
SET RCD=$ORDER(^RCD(340,"AB","DPT(",RCD))
if 'RCD
QUIT
Begin DoDot:1
+4 if '$GET(^RCD(340,+RCD,0))
QUIT
+5 SET DAT=$ORDER(^RC(341,"AD",RCD,2,0))
+6 SET DAT=9999999.999999-DAT
+7 IF DAT>2940428
QUIT
+8 SET DFN=+$GET(^RCD(340,+RCD,0))
DO ELIG^VADPT
+9 IF 'VAEL(1)
QUIT
+10 DO DEM^VADPT
IF +$GET(VADM(6))!VAERR
QUIT
+11 IF $$ACT^PRCAGT(+RCD,DAT)
QUIT
+12 DO NOW^%DTC
SET TODAY=$PIECE(%,".")
+13 SET COM="Waiver rights on statement."
+14 SET PRCABN=$ORDER(^PRCA(430,"AS",+RCD,16,0))
+15 if 'PRCABN
QUIT
+16 IF "^18^22^23^"'[("^"_$PIECE(^PRCA(430,+PRCABN,0),"^",2)_"^")
SET PRCABN=$ORDER(^PRCA(430,"AS",+RCD,16,PRCABN))
+17 if 'PRCABN
QUIT
+18 DO SETTR^PRCAUTL
DO PATTR^PRCAUTL
+19 SET TYP=$ORDER(^PRCA(430.3,"AC",17,0))
+20 SET DR=".03////^S X="_PRCABN_";3////^S X=0;4////^S X=2;12////^S X=TYP;15////^S X=0;42////^S X=$G(DUZ)"
+21 SET DR=DR_";11////^S X=TODAY;5.02////^S X=COM;5.03////^S X="_$$STD^RCCPCFN
+22 SET DA=PRCAEN
SET DIE="^PRCA(433,"
+23 DO ^DIE
+24 DO MAIL
End DoDot:1
+25 if '$ORDER(^RCT(349,0))
SET $PIECE(^RC(342,1,0),"^",13)=$$STD^RCCPCFN
+26 IF $ORDER(^RCT(349,0))
SET X=$PIECE(^RCT(349,$ORDER(^RCT(349,0)),0),"^",9)
SET X=$EXTRACT(X,1,2)_"/"_$EXTRACT(X,3,4)_"/"_$EXTRACT(X,5,8)
DO ^%DT
SET $PIECE(^RC(342,1,0),"^",13)=Y
+27 QUIT
+28 ;
MAIL ;Send message
+1 SET XMSUB="Patient with no previous waiver rights notice"
+2 SET XMDUZ="AR PACKAGE"
+3 SET XMY("G.RCCPC STATEMENTS")=""
+4 SET XMSG(1)="This patient: "_$$NAM^RCFN01(+RCD)_" "_$$SSN^RCFN01(+RCD)
+5 SET XMSG(2)="will receive a statement next statement date with"
+6 SET XMSG(3)="WAIVER RIGHTS and a comment on bill "_$PIECE($GET(^PRCA(430,+PRCABN,0)),"^")
+7 SET XMTEXT="XMSG("
+8 DO ^XMD
+9 QUIT