BGP9C4 ; IHS/CMI/LAB - calc CMS measures ;
;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
;
SCALL ;EP
K BGPDATA
D SCIP^BGP9CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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("BGP9C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=""
Q
;
SCIP1 ;EP
S BGPEX=""
K BGPDATA
D SCIP1^BGP9CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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^BGP9CU5(BGPVINP,"BGP CMS INFECTIOUS DXS") S BGPEX=BGPEX_"1|"
SCIP1A ;
I $G(BGPEXCL),BGPEX]"" Q
S ^XTMP("BGP9C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
Q
;
SCIP3 ;EP
S BGPEX=""
K BGPDATA
D SCIP1^BGP9CU5(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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^BGP9CU5(BGPVINP,"BGP CMS INFECTIOUS DXS") S BGPEX=BGPEX_"1|"
K BGPDATA
D ANTIRX^BGP9CU3(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
I '$D(BGPDATA) S BGPEX=BGPEX_"|7"
SCIP3A ;
I $G(BGPEXCL),BGPEX]"" Q
S ^XTMP("BGP9C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$P(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
Q
;
BGP9C4 ; IHS/CMI/LAB - calc CMS measures ;
+1 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
+2 ;
SCALL ;EP
+1 KILL BGPDATA
+2 DO SCIP^BGP9CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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("BGP9C1",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^BGP9CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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^BGP9CU5(BGPVINP,"BGP CMS INFECTIOUS DXS")
SET BGPEX=BGPEX_"1|"
SCIP1A ;
+1 IF $GET(BGPEXCL)
IF BGPEX]""
QUIT
+2 SET ^XTMP("BGP9C1",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^BGP9CU5(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP9CU(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^BGP9CU5(BGPVINP,"BGP CMS INFECTIOUS DXS")
SET BGPEX=BGPEX_"1|"
+8 KILL BGPDATA
+9 DO ANTIRX^BGP9CU3(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP9CU(BGPVINP),.BGPDATA)
+10 IF '$DATA(BGPDATA)
SET BGPEX=BGPEX_"|7"
SCIP3A ;
+1 IF $GET(BGPEXCL)
IF BGPEX]""
QUIT
+2 SET ^XTMP("BGP9C1",BGPJ,BGPH,"LIST",BGPIND,BGPPLSTL,$PIECE(^DPT(DFN,0),U),DFN,BGPVSIT)=BGPEX
+3 QUIT
+4 ;