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

BGP1C2.m

Go to the documentation of this file.
BGP1C2 ; IHS/CMI/LAB - calc CMS measures 26 Sep 2004 11:28 AM 04 May 2010 2:38 PM ;
 ;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
 ;
HFALL ;EP
 ;was there an AMI pov on this visit
 Q:'$$HFDX^BGP1CU(BGPVSIT)
 I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q  ; no one under 18 at admission date
 I $$LVADEX^BGP1CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) Q  ;
 S ^XTMP("BGP1C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=""
 Q
 ;
HF1 ;EP
 S BGPEX=""
 Q:'$$HFDX^BGP1CU(BGPVSIT)
 I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q  ; no one under 18 at admission date
 I '$$REGDSCH^BGP1CU(BGPVINP) Q  ;not regular discharge so don't count this patient
 I $$LVADEX^BGP1CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=1
HF1A ;
 I $G(BGPEXCL),BGPEX]"" Q
 S ^XTMP("BGP1C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
 Q
 ;
HF2 ;EP
 S BGPEX=""
 Q:'$$HFDX^BGP1CU(BGPVSIT)
 I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q  ; no one under 18 at admission date
 I $$LVADEX^BGP1CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=1
 I $$DEATHAMA^BGP1CU(BGPVINP) S BGPEX=BGPEX_"|2"  ;HF exclusion 2 death or ama
HF2A ;
 I $G(BGPEXCL),BGPEX]"" Q
 S ^XTMP("BGP1C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
 Q
 ;
HF3 ;EP
 S BGPEX=""
 Q:'$$HFDX^BGP1CU(BGPVSIT)
 I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q  ; no one under 18 at admission date
 K BGPDATA S BGPLVSD=0
 D LVSD^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
 I $D(BGPDATA) S BGPLVSD=1
 K BGPDATA S BGPEJEC=0
 D EJECFRAC^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
 I $D(BGPDATA) S BGPEJEC=1
 I 'BGPLVSD,'BGPEJEC Q  ;no lsvd or ejection fraction
 I $$LVADEX^BGP1CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=1
 I $$DEATHAMA^BGP1CU(BGPVINP) S BGPEX=BGPEX_"|2"  ;HF exclusion 2 death or ama
 I $$ACEALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP)),$$ARBALLEG^BGP1CU1(DFN,$$DOB^AUPNPAT(DFN),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=BGPEX_"|6"
 I $$SAORSTEN^BGP1CU1(DFN,$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),-365),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=BGPEX_"|7"
HF3A ;
 I $G(BGPEXCL),BGPEX]"" Q
 S ^XTMP("BGP1C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
 Q
 ;
 ;
HF4 ;EP
 S BGPEX=""
 Q:'$$HFDX^BGP1CU(BGPVSIT)
 I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q  ; no one under 18 at admission date
 K BGPDATA
 D SMOKER^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
 I '$D(BGPDATA) Q  ;not a smoker
 I $$LVADEX^BGP1CU(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) S BGPEX=1
 I $$DEATHAMA^BGP1CU(BGPVINP) S BGPEX=BGPEX_"|2"  ;HF exclusion 2 death or ama
HF4A ;
 I $G(BGPEXCL),BGPEX]"" Q
 S ^XTMP("BGP1C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
 Q
 ;