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

BGPD13.m

Go to the documentation of this file.
BGPD13 ; IHS/CMI/LAB - indicator 13 ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I13 ;EP ;EP - indicator 13
 ;Q:'$D(BGPIND(20))
 I BGPAGEB>5&(BGPAGEB<9) D
 .D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),13,1)
 .S BGPP=$$DENTSEAL(DFN,BGPEDATE) ;sealant anytime in lifetime
 .I BGPP]"" D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),15,1)
 .I $D(BGPLIST(20)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",20,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=BGPP
 I BGPAGEB>13&(BGPAGEB<16) D
 .D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),14,1)
 .S BGPP=$$DENTSEAL(DFN,BGPEDATE) ;sealant anytime in lifetime
 .I BGPP]"" D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),16,1)
 .I $D(BGPLIST(20)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",20,$S($P($G(^AUPNPAT(DFN,11)),U,18)]"":$P(^AUPNPAT(DFN,11),U,18),1:"UNKNOWN"),$P(^DPT(DFN,0),U,2),BGPAGEE,DFN)=BGPP
 Q
S(R,N,P,V) ;
 I 'V Q  ;no value to add
 S $P(^BGPD(R,N),U,P)=$P($G(^BGPD(R,N)),U,P)+V
 Q
 ;
DENTSEAL(P,EDATE) ;
 NEW BGPG,X,%,E,R,V,T
 K BGPG
 S %=P_"^ALL ADA IH73;DURING "_$$FMTE^XLFDT($P(^DPT(P,0),U,3))_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q $$FMTE^XLFDT($P(BGPG(1),U))
 S T=$O(^ATXAX("B","BGP DENTAL SEALANT OP SITES",0))
 I 'T Q ""
 K BGPG
 S %=P_"^ALL ADA 1351;DURING "_$$FMTE^XLFDT($P(^DPT(P,0),U,3))_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I '$D(BGPG(1)) Q ""
 S E=0,R=0 F  S R=$O(BGPG(R)) Q:R'=+R!(E)  D
 .S V=$P($P(BGPG(R),U,4),";")
 .S %=$P(^AUPNVDEN(V,0),U,5) Q:%=""
 .Q:'$D(^ATXAX(T,21,"B",%))
 .S E=1
 .I %="" Q
 Q "Yes - "_$$FMTE^XLFDT($P(BGPG(1),U))
 ;