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

BGPD12.m

Go to the documentation of this file.
BGPD12 ; IHS/CMI/LAB - indicator 12 ;
 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
 ;
I12 ;EP ;EP - indicator 12
 ;Q:'$D(BGPIND(19))
 S BGPP=$$DENT00(DFN,BGPEDATE)
 I BGPP]"" D S(BGPRPT,$S(BGPTIME=1:15,BGPTIME=0:45,BGPTIME=8:85,1:999),12,1)
 I $D(BGPLIST(19)),BGPTIME=1 S ^XTMP("BGPD",BGPJ,BGPH,"LIST",19,$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
 ;
DENT00(P,EDATE) ;
 NEW BGPG,X,%,E,R,V,BDATE
 K BGPG
 S BDATE=$$FMADD^XLFDT(EDATE,-365)
 S %=P_"^LAST ADA 0000;DURING "_$$FMTE^XLFDT(BDATE)_"-"_$$FMTE^XLFDT(EDATE),E=$$START1^APCLDF(%,"BGPG(")
 I $D(BGPG(1)) Q "Yes - "_$$FMTE^XLFDT($P(BGPG(1),U))
 Q ""