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

BGP9C2.m

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