BGP2CP3 ; IHS/CMI/LAB - IHS gpra print 02 Jul 2010 9:07 AM ;
;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
;
;
;
AMI4 ;EP
I $Y>(BGPIOSL-3) D HDR^BGP2CP Q:BGPQUIT D L1H^BGP2CP
D WDT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D WTT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP2CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP2CPU(BGPVSIT)
Q:BGPQUIT
K BGPDATA
S X=$$COMFORT^BGP2CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP2CPU(X)
Q:BGPQUIT
K BGPDATA
S BGPC=0
D SMOKER^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WSMOKER^BGP2CPU
Q:BGPQUIT
K BGPDATA
D CESS^BGP2CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WCESS^BGP2CPU
Q:BGPQUIT
K BGPDATA
D CESSMEDS^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP2CU(BGPVINP),30),.BGPDATA)
D WCESSMED^BGP2CPU
K BGPDATA
Q:BGPQUIT
D ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WALLALG^BGP2CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP2CPU
K BGPDATA
D IVUD^BGP2CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP2CPU
Q
;
AMI4W ;EP
I $Y>(BGPIOSL-3) D HDR^BGP2CP Q:BGPQUIT D L1H^BGP2CP
D WDOD^BGP2CPU(DFN)
D WDT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D WTT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP2CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP2CPU(BGPVSIT)
Q:BGPQUIT
K BGPDATA
S X=$$COMFORT^BGP2CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP2CPU(X)
Q:BGPQUIT
K BGPDATA
S BGPC=0
D SMOKER^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WSMOKER^BGP2CPU
Q:BGPQUIT
K BGPDATA
D CESS^BGP2CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WCESS^BGP2CPU
Q:BGPQUIT
K BGPDATA
D CESSMEDS^BGP2CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WCESSMED^BGP2CPU
K BGPDATA
Q:BGPQUIT
D ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WALLALG^BGP2CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP2CPU
K BGPDATA
D IVUD^BGP2CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP2CPU
Q
;
AMI8AW ;EP
S BGPASTER=0
I $Y>(BGPIOSL-3) D HDR^BGP2CP Q:BGPQUIT D L1H^BGP2CP
I $$TRANSIN^BGP2CU(BGPVINP) D TRANSIN Q:BGPQUIT
D WDT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D WTT^BGP2CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP2CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP2CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP2CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP2CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP2CPU(X)
Q:BGPQUIT
;FIB MEDS
S BGPFIB=""
K BGPDATA
D TARX^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP2CU(BGPVINP),30),0,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
K BGPUD
D IVUD^BGP2CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),$O(^ATXAX("B","BGP CMS THROMBOLYTIC MEDS",0)),.BGPUD,"",$O(^ATXAX("B","BGP THROMBOLYTIC AGENTS CLASS",0)))
S BGPTAPRO=$$LASTPRCI^BGP2UTL1(DFN,"99.10",$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP)) I BGPTAPRO S BGPTAPRO=$$DATE^BGP2UTL($P(BGPTAPRO,U,3))_" ["_$P(BGPTAPRO,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$P(BGPTAPRO,U,5),.04)
D WFIB^BGP2CPU2
Q:BGPQUIT
K BGPST1
S BGPST1=$$LASTDX^BGP2UTL1(DFN,"BGP ST ELEVATION DX",$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP))
I BGPST1 S BGPST1=$$DATE^BGP2UTL($P(BGPST1,U,3))_" ["_$P(BGPST1,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$P(BGPST1,U,5),.04)
D WST^BGP2CPU2
;LBBB ON ECG
K BGPLBPC,BGPLBDX
S BGPLBDX=$$LBBBDX^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP)) I BGPLBDX S BGPLBDX=$$DATE^BGP2UTL($P(BGPLBDX,U,3))_" ["_$P(BGPLBDX,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$P(BGPLBDX,U,5),.04)
D LBBBPROC^BGP2CU2(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP),.BGPLBPC)
D WLBBB^BGP2CPU2
Q:BGPQUIT
S BGPPCI=$$LASTPRCI^BGP2UTL1(DFN,"00.66",$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP)) I BGPPCI S BGPPCI=$$DATE^BGP2UTL($P(BGPPCI,U,3))_" ["_$P(BGPPCI,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$P(BGPPCI,U,5),.04)
D WPCI^BGP2CPU2
Q:BGPQUIT
D ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
D WALLALG^BGP2CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP2CPU
K BGPDATA
D IVUD^BGP2CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP2CPU
Q
;
TRANSIN ;EP
I $Y>(BGPIOSL-4) D HDR^BGP2CP Q:BGPQUIT D L1H^BGP2CP
W !!?3,"NOTE: Since Admission Type was ","""","Transferred,",""""," review patient's chart"
W !,"to determine if patient should be excluded if transfer was from another"
W !,"acute care hospital, including ER from another hospital."
Q
;
TRANSN ;
I $Y>(BGPIOSL-4) D HDR^BGP2CP Q:BGPQUIT D L1H^BGP2CP
W !!?3,"NOTE: Since Discharge Type was ","""","Transferred,",""""," review patient's chart"
W !,"to determine if patient should be excluded if transferred to another"
W !,"acute care hospital or federal hospital."
Q
;
BGP2CP3 ; IHS/CMI/LAB - IHS gpra print 02 Jul 2010 9:07 AM ;
+1 ;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
+2 ;
+3 ;
+4 ;
AMI4 ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP2CP
IF BGPQUIT
QUIT
DO L1H^BGP2CP
+2 DO WDT^BGP2CPU(BGPVINP)
+3 IF BGPQUIT
QUIT
+4 IF $$TRANS^BGP2CU(BGPVINP)
DO WTT^BGP2CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP2CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+7 DO WPPDPOV^BGP2CPU(BGPVSIT)
+8 IF BGPQUIT
QUIT
+9 DO OTHDPOVS^BGP2CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 KILL BGPDATA
+12 SET X=$$COMFORT^BGP2CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+13 DO WCOMFORT^BGP2CPU(X)
+14 IF BGPQUIT
QUIT
+15 KILL BGPDATA
+16 SET BGPC=0
+17 DO SMOKER^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+18 DO WSMOKER^BGP2CPU
+19 IF BGPQUIT
QUIT
+20 KILL BGPDATA
+21 DO CESS^BGP2CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+22 DO WCESS^BGP2CPU
+23 IF BGPQUIT
QUIT
+24 KILL BGPDATA
+25 DO CESSMEDS^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP2CU(BGPVINP),30),.BGPDATA)
+26 DO WCESSMED^BGP2CPU
+27 KILL BGPDATA
+28 IF BGPQUIT
QUIT
+29 DO ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+30 DO WALLALG^BGP2CPU
+31 IF BGPQUIT
QUIT
+32 KILL BGPDATA
+33 DO ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
+34 DO WALLALGT^BGP2CPU
+35 KILL BGPDATA
+36 DO IVUD^BGP2CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
+37 DO WIVUD^BGP2CPU
+38 QUIT
+39 ;
AMI4W ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP2CP
IF BGPQUIT
QUIT
DO L1H^BGP2CP
+2 DO WDOD^BGP2CPU(DFN)
+3 DO WDT^BGP2CPU(BGPVINP)
+4 IF BGPQUIT
QUIT
+5 IF $$TRANS^BGP2CU(BGPVINP)
DO WTT^BGP2CPU(BGPVINP)
+6 IF BGPQUIT
QUIT
+7 IF $$TRANS^BGP2CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+8 DO WPPDPOV^BGP2CPU(BGPVSIT)
+9 IF BGPQUIT
QUIT
+10 DO OTHDPOVS^BGP2CPU(BGPVSIT)
+11 IF BGPQUIT
QUIT
+12 KILL BGPDATA
+13 SET X=$$COMFORT^BGP2CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+14 DO WCOMFORT^BGP2CPU(X)
+15 IF BGPQUIT
QUIT
+16 KILL BGPDATA
+17 SET BGPC=0
+18 DO SMOKER^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+19 DO WSMOKER^BGP2CPU
+20 IF BGPQUIT
QUIT
+21 KILL BGPDATA
+22 DO CESS^BGP2CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+23 DO WCESS^BGP2CPU
+24 IF BGPQUIT
QUIT
+25 KILL BGPDATA
+26 DO CESSMEDS^BGP2CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+27 DO WCESSMED^BGP2CPU
+28 KILL BGPDATA
+29 IF BGPQUIT
QUIT
+30 DO ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+31 DO WALLALG^BGP2CPU
+32 IF BGPQUIT
QUIT
+33 KILL BGPDATA
+34 DO ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
+35 DO WALLALGT^BGP2CPU
+36 KILL BGPDATA
+37 DO IVUD^BGP2CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
+38 DO WIVUD^BGP2CPU
+39 QUIT
+40 ;
AMI8AW ;EP
+1 SET BGPASTER=0
+2 IF $Y>(BGPIOSL-3)
DO HDR^BGP2CP
IF BGPQUIT
QUIT
DO L1H^BGP2CP
+3 IF $$TRANSIN^BGP2CU(BGPVINP)
DO TRANSIN
IF BGPQUIT
QUIT
+4 DO WDT^BGP2CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP2CU(BGPVINP)
DO WTT^BGP2CPU(BGPVINP)
+7 IF BGPQUIT
QUIT
+8 IF $$TRANS^BGP2CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+9 DO WPPDPOV^BGP2CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 DO OTHDPOVS^BGP2CPU(BGPVSIT)
+12 IF BGPQUIT
QUIT
+13 SET X=$$COMFORT^BGP2CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+14 DO WCOMFORT^BGP2CPU(X)
+15 IF BGPQUIT
QUIT
+16 ;FIB MEDS
+17 SET BGPFIB=""
+18 KILL BGPDATA
+19 DO TARX^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP2CU(BGPVINP),30),0,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+20 KILL BGPUD
+21 DO IVUD^BGP2CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),$ORDER(^ATXAX("B","BGP CMS THROMBOLYTIC MEDS",0)),.BGPUD,"",$ORDER(^ATXAX("B","BGP THROMBOLYTIC AGENTS CLASS",0)))
+22 SET BGPTAPRO=$$LASTPRCI^BGP2UTL1(DFN,"99.10",$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP))
IF BGPTAPRO
SET BGPTAPRO=$$DATE^BGP2UTL($PIECE(BGPTAPRO,U,3))_" ["_$PIECE(BGPTAPRO,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$PIECE(BGPTAPRO,U,5),.04)
+23 DO WFIB^BGP2CPU2
+24 IF BGPQUIT
QUIT
+25 KILL BGPST1
+26 SET BGPST1=$$LASTDX^BGP2UTL1(DFN,"BGP ST ELEVATION DX",$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP))
+27 IF BGPST1
SET BGPST1=$$DATE^BGP2UTL($PIECE(BGPST1,U,3))_" ["_$PIECE(BGPST1,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$PIECE(BGPST1,U,5),.04)
+28 DO WST^BGP2CPU2
+29 ;LBBB ON ECG
+30 KILL BGPLBPC,BGPLBDX
+31 SET BGPLBDX=$$LBBBDX^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP))
IF BGPLBDX
SET BGPLBDX=$$DATE^BGP2UTL($PIECE(BGPLBDX,U,3))_" ["_$PIECE(BGPLBDX,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$PIECE(BGPLBDX,U,5),.04)
+32 DO LBBBPROC^BGP2CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP2CU(BGPVINP),.BGPLBPC)
+33 DO WLBBB^BGP2CPU2
+34 IF BGPQUIT
QUIT
+35 SET BGPPCI=$$LASTPRCI^BGP2UTL1(DFN,"00.66",$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP))
IF BGPPCI
SET BGPPCI=$$DATE^BGP2UTL($PIECE(BGPPCI,U,3))_" ["_$PIECE(BGPPCI,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$PIECE(BGPPCI,U,5),.04)
+36 DO WPCI^BGP2CPU2
+37 IF BGPQUIT
QUIT
+38 DO ALLALG1^BGP2CU1(DFN,DT,$$DSCH^BGP2CU(BGPVINP),.BGPDATA)
+39 DO WALLALG^BGP2CPU
+40 IF BGPQUIT
QUIT
+41 KILL BGPDATA
+42 DO ALLALGA1^BGP2CU1(DFN,DT,.BGPDATA)
+43 DO WALLALGT^BGP2CPU
+44 KILL BGPDATA
+45 DO IVUD^BGP2CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP2CU(BGPVINP),,.BGPDATA)
+46 DO WIVUD^BGP2CPU
+47 QUIT
+48 ;
TRANSIN ;EP
+1 IF $Y>(BGPIOSL-4)
DO HDR^BGP2CP
IF BGPQUIT
QUIT
DO L1H^BGP2CP
+2 WRITE !!?3,"NOTE: Since Admission Type was ","""","Transferred,",""""," review patient's chart"
+3 WRITE !,"to determine if patient should be excluded if transfer was from another"
+4 WRITE !,"acute care hospital, including ER from another hospital."
+5 QUIT
+6 ;
TRANSN ;
+1 IF $Y>(BGPIOSL-4)
DO HDR^BGP2CP
IF BGPQUIT
QUIT
DO L1H^BGP2CP
+2 WRITE !!?3,"NOTE: Since Discharge Type was ","""","Transferred,",""""," review patient's chart"
+3 WRITE !,"to determine if patient should be excluded if transferred to another"
+4 WRITE !,"acute care hospital or federal hospital."
+5 QUIT
+6 ;