BGP1CP3 ; IHS/CMI/LAB - IHS gpra print 02 Jul 2010 9:07 AM ;
;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
;
;
;
AMI4 ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
K BGPDATA
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
K BGPDATA
S BGPC=0
D SMOKER^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WSMOKER^BGP1CPU
Q:BGPQUIT
K BGPDATA
D CESS^BGP1CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WCESS^BGP1CPU
Q:BGPQUIT
K BGPDATA
D CESSMEDS^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),30),.BGPDATA)
D WCESSMED^BGP1CPU
K BGPDATA
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
;
AMI4W ;EP
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
D WDOD^BGP1CPU(DFN)
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
K BGPDATA
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
K BGPDATA
S BGPC=0
D SMOKER^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WSMOKER^BGP1CPU
Q:BGPQUIT
K BGPDATA
D CESS^BGP1CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WCESS^BGP1CPU
Q:BGPQUIT
K BGPDATA
D CESSMEDS^BGP1CU2(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WCESSMED^BGP1CPU
K BGPDATA
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
;
AMI8AW ;EP
S BGPASTER=0
I $Y>(BGPIOSL-3) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
I $$TRANSIN^BGP1CU(BGPVINP) D TRANSIN Q:BGPQUIT
D WDT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D WTT^BGP1CPU(BGPVINP)
Q:BGPQUIT
I $$TRANS^BGP1CU(BGPVINP) D TRANSN Q:BGPQUIT
D WPPDPOV^BGP1CPU(BGPVSIT)
Q:BGPQUIT
D OTHDPOVS^BGP1CPU(BGPVSIT)
Q:BGPQUIT
S X=$$COMFORT^BGP1CU(DFN,$P($P(^AUPNVSIT(BGPVSIT,0),U),"."),$P($P(^AUPNVINP(BGPVINP,0),U),"."))
D WCOMFORT^BGP1CPU(X)
Q:BGPQUIT
;FIB MEDS
S BGPFIB=""
K BGPDATA
D TARX^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),30),0,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
K BGPUD
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$O(^ATXAX("B","BGP CMS THROMBOLYTIC MEDS",0)),.BGPUD,"",$O(^ATXAX("B","BGP THROMBOLYTIC AGENTS CLASS",0)))
S BGPTAPRO=$$LASTPRCI^BGP1UTL1(DFN,"99.10",$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) I BGPTAPRO S BGPTAPRO=$$DATE^BGP1UTL($P(BGPTAPRO,U,3))_" ["_$P(BGPTAPRO,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$P(BGPTAPRO,U,5),.04)
D WFIB^BGP1CPU2
Q:BGPQUIT
K BGPST1
S BGPST1=$$LASTDX^BGP1UTL1(DFN,"BGP ST ELEVATION DX",$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP))
I BGPST1 S BGPST1=$$DATE^BGP1UTL($P(BGPST1,U,3))_" ["_$P(BGPST1,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$P(BGPST1,U,5),.04)
D WST^BGP1CPU2
;LBBB ON ECG
K BGPLBPC,BGPLBDX
S BGPLBDX=$$LBBBDX^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP)) I BGPLBDX S BGPLBDX=$$DATE^BGP1UTL($P(BGPLBDX,U,3))_" ["_$P(BGPLBDX,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$P(BGPLBDX,U,5),.04)
D LBBBPROC^BGP1CU2(DFN,$$FMADD^XLFDT($P($P(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP),.BGPLBPC)
D WLBBB^BGP1CPU2
Q:BGPQUIT
S BGPPCI=$$LASTPRCI^BGP1UTL1(DFN,"00.66",$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP)) I BGPPCI S BGPPCI=$$DATE^BGP1UTL($P(BGPPCI,U,3))_" ["_$P(BGPPCI,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$P(BGPPCI,U,5),.04)
D WPCI^BGP1CPU2
Q:BGPQUIT
D ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
D WALLALG^BGP1CPU
Q:BGPQUIT
K BGPDATA
D ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
D WALLALGT^BGP1CPU
K BGPDATA
D IVUD^BGP1CU1(DFN,$P($P(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
D WIVUD^BGP1CPU
Q
;
TRANSIN ;EP
I $Y>(BGPIOSL-4) D HDR^BGP1CP Q:BGPQUIT D L1H^BGP1CP
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^BGP1CP Q:BGPQUIT D L1H^BGP1CP
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
;
BGP1CP3 ; IHS/CMI/LAB - IHS gpra print 02 Jul 2010 9:07 AM ;
+1 ;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
+2 ;
+3 ;
+4 ;
AMI4 ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 DO WDT^BGP1CPU(BGPVINP)
+3 IF BGPQUIT
QUIT
+4 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+7 DO WPPDPOV^BGP1CPU(BGPVSIT)
+8 IF BGPQUIT
QUIT
+9 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 KILL BGPDATA
+12 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+13 DO WCOMFORT^BGP1CPU(X)
+14 IF BGPQUIT
QUIT
+15 KILL BGPDATA
+16 SET BGPC=0
+17 DO SMOKER^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+18 DO WSMOKER^BGP1CPU
+19 IF BGPQUIT
QUIT
+20 KILL BGPDATA
+21 DO CESS^BGP1CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+22 DO WCESS^BGP1CPU
+23 IF BGPQUIT
QUIT
+24 KILL BGPDATA
+25 DO CESSMEDS^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),30),.BGPDATA)
+26 DO WCESSMED^BGP1CPU
+27 KILL BGPDATA
+28 IF BGPQUIT
QUIT
+29 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+30 DO WALLALG^BGP1CPU
+31 IF BGPQUIT
QUIT
+32 KILL BGPDATA
+33 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+34 DO WALLALGT^BGP1CPU
+35 KILL BGPDATA
+36 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+37 DO WIVUD^BGP1CPU
+38 QUIT
+39 ;
AMI4W ;EP
+1 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+2 DO WDOD^BGP1CPU(DFN)
+3 DO WDT^BGP1CPU(BGPVINP)
+4 IF BGPQUIT
QUIT
+5 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+6 IF BGPQUIT
QUIT
+7 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+8 DO WPPDPOV^BGP1CPU(BGPVSIT)
+9 IF BGPQUIT
QUIT
+10 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+11 IF BGPQUIT
QUIT
+12 KILL BGPDATA
+13 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+14 DO WCOMFORT^BGP1CPU(X)
+15 IF BGPQUIT
QUIT
+16 KILL BGPDATA
+17 SET BGPC=0
+18 DO SMOKER^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+19 DO WSMOKER^BGP1CPU
+20 IF BGPQUIT
QUIT
+21 KILL BGPDATA
+22 DO CESS^BGP1CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+23 DO WCESS^BGP1CPU
+24 IF BGPQUIT
QUIT
+25 KILL BGPDATA
+26 DO CESSMEDS^BGP1CU2(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+27 DO WCESSMED^BGP1CPU
+28 KILL BGPDATA
+29 IF BGPQUIT
QUIT
+30 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+31 DO WALLALG^BGP1CPU
+32 IF BGPQUIT
QUIT
+33 KILL BGPDATA
+34 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+35 DO WALLALGT^BGP1CPU
+36 KILL BGPDATA
+37 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+38 DO WIVUD^BGP1CPU
+39 QUIT
+40 ;
AMI8AW ;EP
+1 SET BGPASTER=0
+2 IF $Y>(BGPIOSL-3)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+3 IF $$TRANSIN^BGP1CU(BGPVINP)
DO TRANSIN
IF BGPQUIT
QUIT
+4 DO WDT^BGP1CPU(BGPVINP)
+5 IF BGPQUIT
QUIT
+6 IF $$TRANS^BGP1CU(BGPVINP)
DO WTT^BGP1CPU(BGPVINP)
+7 IF BGPQUIT
QUIT
+8 IF $$TRANS^BGP1CU(BGPVINP)
DO TRANSN
IF BGPQUIT
QUIT
+9 DO WPPDPOV^BGP1CPU(BGPVSIT)
+10 IF BGPQUIT
QUIT
+11 DO OTHDPOVS^BGP1CPU(BGPVSIT)
+12 IF BGPQUIT
QUIT
+13 SET X=$$COMFORT^BGP1CU(DFN,$PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),$PIECE($PIECE(^AUPNVINP(BGPVINP,0),U),"."))
+14 DO WCOMFORT^BGP1CPU(X)
+15 IF BGPQUIT
QUIT
+16 ;FIB MEDS
+17 SET BGPFIB=""
+18 KILL BGPDATA
+19 DO TARX^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(^AUPNVSIT(BGPVSIT,0),U),"."),-365),$$FMADD^XLFDT($$DSCH^BGP1CU(BGPVINP),30),0,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+20 KILL BGPUD
+21 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),$ORDER(^ATXAX("B","BGP CMS THROMBOLYTIC MEDS",0)),.BGPUD,"",$ORDER(^ATXAX("B","BGP THROMBOLYTIC AGENTS CLASS",0)))
+22 SET BGPTAPRO=$$LASTPRCI^BGP1UTL1(DFN,"99.10",$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP))
IF BGPTAPRO
SET BGPTAPRO=$$DATE^BGP1UTL($PIECE(BGPTAPRO,U,3))_" ["_$PIECE(BGPTAPRO,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$PIECE(BGPTAPRO,U,5),.04)
+23 DO WFIB^BGP1CPU2
+24 IF BGPQUIT
QUIT
+25 KILL BGPST1
+26 SET BGPST1=$$LASTDX^BGP1UTL1(DFN,"BGP ST ELEVATION DX",$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP))
+27 IF BGPST1
SET BGPST1=$$DATE^BGP1UTL($PIECE(BGPST1,U,3))_" ["_$PIECE(BGPST1,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$PIECE(BGPST1,U,5),.04)
+28 DO WST^BGP1CPU2
+29 ;LBBB ON ECG
+30 KILL BGPLBPC,BGPLBDX
+31 SET BGPLBDX=$$LBBBDX^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP))
IF BGPLBDX
SET BGPLBDX=$$DATE^BGP1UTL($PIECE(BGPLBDX,U,3))_" ["_$PIECE(BGPLBDX,U,2)_"] "_$$VAL^XBDIQ1(9000010.07,$PIECE(BGPLBDX,U,5),.04)
+32 DO LBBBPROC^BGP1CU2(DFN,$$FMADD^XLFDT($PIECE($PIECE(BGPVSIT0,U),"."),-1),$$DSCH^BGP1CU(BGPVINP),.BGPLBPC)
+33 DO WLBBB^BGP1CPU2
+34 IF BGPQUIT
QUIT
+35 SET BGPPCI=$$LASTPRCI^BGP1UTL1(DFN,"00.66",$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP))
IF BGPPCI
SET BGPPCI=$$DATE^BGP1UTL($PIECE(BGPPCI,U,3))_" ["_$PIECE(BGPPCI,U,2)_"] "_$$VAL^XBDIQ1(9000010.08,$PIECE(BGPPCI,U,5),.04)
+36 DO WPCI^BGP1CPU2
+37 IF BGPQUIT
QUIT
+38 DO ALLALG1^BGP1CU1(DFN,DT,$$DSCH^BGP1CU(BGPVINP),.BGPDATA)
+39 DO WALLALG^BGP1CPU
+40 IF BGPQUIT
QUIT
+41 KILL BGPDATA
+42 DO ALLALGA1^BGP1CU1(DFN,DT,.BGPDATA)
+43 DO WALLALGT^BGP1CPU
+44 KILL BGPDATA
+45 DO IVUD^BGP1CU1(DFN,$PIECE($PIECE(BGPVSIT0,U),"."),$$DSCH^BGP1CU(BGPVINP),,.BGPDATA)
+46 DO WIVUD^BGP1CPU
+47 QUIT
+48 ;
TRANSIN ;EP
+1 IF $Y>(BGPIOSL-4)
DO HDR^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+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^BGP1CP
IF BGPQUIT
QUIT
DO L1H^BGP1CP
+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 ;