BGP2C4 ; IHS/CMI/LAB - calc CMS measures ;
;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
;
SCALL ;EP
K BGPDATA
D SCIP^BGP2CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
Q:'$D(BGPDATA)
K BGPDATA
I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q ; no one under 18 at admission date
S ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=""
Q
;
SCIP1 ;EP
S BGPEX=""
K BGPDATA
D SCIP1^BGP2CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
I '$D(BGPDATA) Q ;no procedure
I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q ; no one under 18 at admission date
;exclusions
I $$ADMPRIM^BGP2CU5(BGPVINP,"BGP CMS INFECTIOUS DXS") S BGPEX=BGPEX_"1|"
SCIP1A ;
I $G(BGPEXCL),BGPEX]"" Q
S ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
Q
;
SCIP3 ;EP
S BGPEX=""
K BGPDATA
D SCIP1^BGP2CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
I '$D(BGPDATA) Q ;no procedure
I $$AGE^AUPNPAT(DFN,$P($P(BGPVSIT0,U),"."))<18 Q ; no one under 18 at admission date
;exclusions
I $$ADMPRIM^BGP2CU5(BGPVINP,"BGP CMS INFECTIOUS DXS") S BGPEX=BGPEX_"1|"
K BGPDATA
D ANTIRX^BGP2CU3(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
I '$D(BGPDATA) S BGPEX=BGPEX_"|7"
SCIP3A ;
I $G(BGPEXCL),BGPEX]"" Q
S ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
Q
;
BGP2C4 ; IHS/CMI/LAB - calc CMS measures ;
+1 ;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
+2 ;
SCALL ;EP
+1 KILL BGPDATA
+2 DO SCIP^BGP2CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+3 IF '$DATA(BGPDATA)
QUIT
+4 KILL BGPDATA
+5 ; no one under 18 at admission date
IF $$AGE^AUPNPAT(DFN,$PIECE($PIECE(BGPVSIT0,U),"."))<18
QUIT
+6 SET ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$PIECE(^DPT(DFN,0),U),DFN,BGPVSIT)=""
+7 QUIT
+8 ;
SCIP1 ;EP
+1 SET BGPEX=""
+2 KILL BGPDATA
+3 DO SCIP1^BGP2CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+4 ;no procedure
IF '$DATA(BGPDATA)
QUIT
+5 ; no one under 18 at admission date
IF $$AGE^AUPNPAT(DFN,$PIECE($PIECE(BGPVSIT0,U),"."))<18
QUIT
+6 ;exclusions
+7 IF $$ADMPRIM^BGP2CU5(BGPVINP,"BGP CMS INFECTIOUS DXS")
SET BGPEX=BGPEX_"1|"
SCIP1A ;
+1 IF $GET(BGPEXCL)
IF BGPEX]""
QUIT
+2 SET ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$PIECE(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
+3 QUIT
+4 ;
SCIP3 ;EP
+1 SET BGPEX=""
+2 KILL BGPDATA
+3 DO SCIP1^BGP2CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+4 ;no procedure
IF '$DATA(BGPDATA)
QUIT
+5 ; no one under 18 at admission date
IF $$AGE^AUPNPAT(DFN,$PIECE($PIECE(BGPVSIT0,U),"."))<18
QUIT
+6 ;exclusions
+7 IF $$ADMPRIM^BGP2CU5(BGPVINP,"BGP CMS INFECTIOUS DXS")
SET BGPEX=BGPEX_"1|"
+8 KILL BGPDATA
+9 DO ANTIRX^BGP2CU3(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+10 IF '$DATA(BGPDATA)
SET BGPEX=BGPEX_"|7"
SCIP3A ;
+1 IF $GET(BGPEXCL)
IF BGPEX]""
QUIT
+2 SET ^XTMP("BGP2C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$PIECE(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
+3 QUIT
+4 ;