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

ABMDREL2.m

Go to the documentation of this file.
ABMDREL2 ; IHS/ASDST/DMJ - process billing report holders ;
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;Original;TMD;
 ;
START ;
 S ABMD("BT")=$H
 S (ABMD("DFN"),ABMD("TOT"))=0 K ^TMP("ABMDBRH",ABMD("$J"))
 D @ABMD("PROC")
 Q
 ;
MCRA ;
 F  S ABMD("DFN")=$O(^AUPNMCR(ABMD("DFN"))) Q:'ABMD("DFN")  D MCRA2
 Q
MCRA2 ;
 Q:'$D(^AUPNMCR(ABMD("DFN"),11))
 Q:'$D(^AUPNPAT(ABMD("DFN"),41,ABMD("SU"),0))
 Q:'$D(^DPT(ABMD("DFN"),0))
 I $D(^DPT(ABMD("DFN"),.35)),$P(^(.35),U,1)]"",$P(^(.35),U,1)<ABMD("ACE") Q
 S ABMD("PN")=$P(^DPT(ABMD("DFN"),0),U)
 S ABMD("MDFN")=0 F  S ABMD("MDFN")=$O(^AUPNMCR(ABMD("DFN"),11,ABMD("MDFN"))) Q:'ABMD("MDFN")  D MCRA3
 Q:'$D(^TMP("ABMDBRH",ABMD("$J"),ABMD("PN")))
 S ABMD("TOT")=ABMD("TOT")+1
 K ABMD("PN")
 Q
 ;
MCRA3 ;
 Q:ABMD("VAL")'[$P(^AUPNMCR(ABMD("DFN"),11,ABMD("MDFN"),0),U,3)
 Q:$P(^AUPNMCR(ABMD("DFN"),11,ABMD("MDFN"),0),U,1)>ABMD("ACE")
 I $P(^AUPNMCR(ABMD("DFN"),11,ABMD("MDFN"),0),U,2)]"",$P(^(0),U,2)<ABMD("ACE") Q
 S ^TMP("ABMDBRH",ABMD("$J"),ABMD("PN"),ABMD("DFN"),ABMD("MDFN"))=""
 Q
 ;
PI ;
 F  S ABMD("DFN")=$O(^AUPNPRVT(ABMD("DFN"))) Q:'ABMD("DFN")  D PI2
 Q
PI2 ;
 Q:'$D(^AUPNPAT(ABMD("DFN"),41,ABMD("SU")))
 I $D(^DPT(ABMD("DFN"),.35)),$P(^(.35),U,1)]"",$P(^(.35),U,1)<ABMD("ACE") Q
 Q:'$D(^AUPNPRVT(ABMD("DFN"),11))
 S ABMD("PN")=$P(^DPT(ABMD("DFN"),0),U)
 S ABMD("MDFN")=0 F  S ABMD("MDFN")=$O(^AUPNPRVT(ABMD("DFN"),11,ABMD("MDFN"))) Q:'ABMD("MDFN")  D PI3
 Q:'$D(^TMP("ABMDBRH",ABMD("$J"),ABMD("PN")))
 S ABMD("TOT")=ABMD("TOT")+1
 K ABMD("PN")
 Q
PI3 ;
 Q:$P(^AUPNPRVT(ABMD("DFN"),11,ABMD("MDFN"),0),U)=""
 S ABMD("NAME")=$P(^AUPNPRVT(ABMD("DFN"),11,ABMD("MDFN"),0),U) Q:ABMD("NAME")=""
 Q:'$D(^AUTNINS(ABMD("NAME"),0))
 S ABMD("NAME")=$P(^AUTNINS(ABMD("NAME"),0),U) I ABMD("NAME")["AHCCCS" Q
 Q:$P(^AUPNPRVT(ABMD("DFN"),11,ABMD("MDFN"),0),U,6)>ABMD("ACE")
 I $P(^AUPNPRVT(ABMD("DFN"),11,ABMD("MDFN"),0),U,7)]"",$P(^(0),U,7)<ABMD("ACE") Q
 S ^TMP("ABMDBRH",ABMD("$J"),ABMD("PN"),ABMD("DFN"),ABMD("MDFN"))=""
 Q
 ;
MCD ;
 F  S ABMD("DFN")=$O(^AUPNMCD("B",ABMD("DFN"))) Q:'ABMD("DFN")  D MCD2
 Q
MCD2 ;
 Q:'$D(^AUPNPAT(ABMD("DFN"),41,ABMD("SU")))
 I $D(^DPT(ABMD("DFN"),.35)),$P(^(.35),U,1)]"",$P(^(.35),U,1)<ABMD("ACE") Q
 S ABMD("PN")=$P(^DPT(ABMD("DFN"),0),U)
 S ABMD("MDFN")=0 S ABMD("MDFN")=$O(^AUPNMCD("B",ABMD("DFN"),ABMD("MDFN"))) Q:'ABMD("MDFN")  D MCD3
 Q:'$D(^TMP("ABMDBRH",ABMD("$J"),ABMD("PN")))
 S ABMD("TOT")=ABMD("TOT")+1
 K ABMD("PN")
 Q
MCD3 ;
 Q:'$D(^AUPNMCD(ABMD("MDFN"),11))
 S ABMD("NDFN")=0 F  S ABMD("NDFN")=$O(^AUPNMCD(ABMD("MDFN"),11,ABMD("NDFN"))) Q:'ABMD("NDFN")  S ABMD("R")=^AUPNMCD(ABMD("MDFN"),11,ABMD("NDFN"),0) D MCD4
 Q
MCD4 ;
 Q:ABMD("NDFN")>ABMD("ACE")
 I $P(ABMD("R"),U,2)]"",$P(ABMD("R"),U,2)<ABMD("ACE") Q
 S ^TMP("ABMDBRH",ABMD("$J"),ABMD("PN"),ABMD("DFN"),ABMD("MDFN"),ABMD("NDFN"))=""
 Q