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

APCLBRH2.m

Go to the documentation of this file.
  1. APCLBRH2 ; IHS/CMI/LAB - process billing report holders ;
  1. ;;2.0;IHS PCC SUITE;**8**;MAY 14, 2009;Build 2
  1. ;
  1. START ;
  1. S APCLBT=$H,APCLJOB=$J
  1. S (DFN,APCLTOT)=0 K ^XTMP("APCLBRH",APCLJOB,APCLBT)
  1. D XTMP^APCLOSUT("APCLBRH","PCC - PATS WITH 3RD PARTY")
  1. D @APCLPROC
  1. S APCLET=$H
  1. Q
  1. ;
  1. MCRA ;
  1. F S DFN=$O(^AUPNMCR(DFN)) Q:DFN'=+DFN I '$$DEMO^APCLUTL(DFN,$G(APCLDEMO)) D MCRA2
  1. Q
  1. MCRA2 ;
  1. Q:'$D(^AUPNMCR(DFN,11))
  1. Q:'$D(^AUPNPAT(DFN,41,APCLSU,0))
  1. Q:'$D(^DPT(DFN,0))
  1. Q:$$DEMO^APCLUTL(DFN,$G(APCLDEMO))
  1. I $D(^DPT(DFN,.35)),$P(^(.35),U)]"",$P(^(.35),U)<APCLACE Q
  1. S APCLPN=$P(^DPT(DFN,0),U)
  1. S APCLMDFN=0 F S APCLMDFN=$O(^AUPNMCR(DFN,11,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN D MCRA3
  1. Q:'$D(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN))
  1. S APCLTOT=APCLTOT+1
  1. K APCLPN
  1. Q
  1. ;
  1. MCRA3 ;
  1. Q:APCLVAL'[$P(^AUPNMCR(DFN,11,APCLMDFN,0),U,3)
  1. Q:$P(^AUPNMCR(DFN,11,APCLMDFN,0),U)>APCLACE
  1. I $P(^AUPNMCR(DFN,11,APCLMDFN,0),U,2)]"",$P(^(0),U,2)<APCLACE Q
  1. S ^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN)=""
  1. Q
  1. ;
  1. PI ;
  1. F S DFN=$O(^AUPNPRVT(DFN)) Q:DFN'=+DFN I '$$DEMO^APCLUTL(DFN,$G(APCLDEMO)) D PI2
  1. Q
  1. PI2 ;
  1. Q:'$D(^AUPNPAT(DFN,41,APCLSU))
  1. I $D(^DPT(DFN,.35)),$P(^(.35),U)]"",$P(^(.35),U)<APCLACE Q
  1. Q:'$D(^AUPNPRVT(DFN,11))
  1. S APCLPN=$P(^DPT(DFN,0),U)
  1. S APCLMDFN=0 F S APCLMDFN=$O(^AUPNPRVT(DFN,11,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN D PI3
  1. Q:'$D(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN))
  1. S APCLTOT=APCLTOT+1
  1. K APCLPN
  1. Q
  1. PI3 ;
  1. Q:$P(^AUPNPRVT(DFN,11,APCLMDFN,0),U)=""
  1. S APCLNAME=$P(^AUPNPRVT(DFN,11,APCLMDFN,0),U) Q:APCLNAME=""
  1. S APCLNAME=$P(^AUTNINS(APCLNAME,0),U) I APCLNAME["AHCCCS" Q
  1. Q:$P(^AUPNPRVT(DFN,11,APCLMDFN,0),U,6)>APCLACE
  1. I $P(^AUPNPRVT(DFN,11,APCLMDFN,0),U,7)]"",$P(^(0),U,7)<APCLACE Q
  1. S ^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN)=""
  1. Q
  1. ;
  1. MCD ;
  1. F S DFN=$O(^AUPNMCD("B",DFN)) Q:DFN'=+DFN I '$$DEMO^APCLUTL(DFN,$G(APCLDEMO)) D MCD2
  1. Q
  1. MCD2 ;
  1. Q:'$D(^AUPNPAT(DFN,41,APCLSU))
  1. I $D(^DPT(DFN,.35)),$P(^(.35),U)]"",$P(^(.35),U)<APCLACE Q
  1. S APCLPN=$P(^DPT(DFN,0),U)
  1. S APCLMDFN=0 S APCLMDFN=$O(^AUPNMCD("B",DFN,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN D MCD3
  1. Q:'$D(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN))
  1. S APCLTOT=APCLTOT+1
  1. K APCLPN
  1. Q
  1. MCD3 ;
  1. Q:'$D(^AUPNMCD(APCLMDFN,11))
  1. S APCLNDFN=0 F S APCLNDFN=$O(^AUPNMCD(APCLMDFN,11,APCLNDFN)) Q:APCLNDFN'=+APCLNDFN S APCLR=^AUPNMCD(APCLMDFN,11,APCLNDFN,0) D MCD4
  1. Q
  1. MCD4 ;
  1. Q:APCLNDFN>APCLACE
  1. I $P(APCLR,U,2)]"",$P(APCLR,U,2)<APCLACE Q
  1. S ^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN,APCLNDFN)=""
  1. Q