BGP1D713 ; IHS/CMI/LAB - measure 31 ;
;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
;
PREGSCRN ;EP
S BGPTOB=$$TOBHF^BGP1D712(DFN,BGP20M,BGPEDATE)
S BGPSDX=$$DX^BGP1D7(DFN,BGP20M,BGPEDATE)
S BGPXPBD=$$PED^BGP1D7(DFN,BGP20M,BGPEDATE)
S BGP1320=$$DENT^BGP1D7(DFN,BGP20M,BGPEDATE)
S BGPSCPT=$$CPTSM^BGP1D7(DFN,BGP20M,BGPEDATE)
S BGPN6=$S(BGPTOB]"":1,1:0)
I BGPSDX]"" S BGPN6=1
I BGPXPBD]"" S BGPN6=1
I BGP1320]"" S BGPN6=1
I BGPSCPT]"" S BGPN6=1
S (BGPVALUE,BGPVAL)=""
S F=BGPTOB
S %=""
I BGPSDX]"",$P(BGPSDX,U,1)="305.13" S %=1
I BGPSDX]"",$P(BGPSDX,U,1)="V15.82" S %=1
;BGPN7 - USER
D
.I $P(F,U,1)["CURRENT"!($P(F,U,1)["CESSATION") S BGPN7=1,BGPVAL=$P(BGPTOB,U,2)_" SCREEN (20 MONTHS), "_$P(BGPTOB,U,2)_" USER" Q
.I $P(F,U,4)["CURRENT"!($P(F,U,4)["CESSATION") S BGPN7=1,BGPVAL=$P(BGPTOB,U,2)_" SCREEN (20 MONTHS), "_$P(BGPTOB,U,2)_" USER" Q
.I (BGPSDX]""&(%="")) S BGPN7=1,BGPVAL=$$DATE^BGP1UTL($P(BGPSDX,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($P(BGPSDX,U,2))_" USER" Q
.I ($P(BGPSCPT,U)="1034F")!($P(BGPSCPT,U)="1035F")!($P(BGPSCPT,U)="G0376")!($P(BGPSCPT,U)="G0375")!($P(BGPSCPT,U)=99407) S BGPN7=1,BGPVAL=$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" USER" Q
.I $P(BGPSCPT,U)=99406!($P(BGPSCPT,U)="G8455")!($P(BGPSCPT,U)="G8456")!($P(BGPSCPT,U)="G8402")!($P(BGPSCPT,U)="G8453") S BGPN7=1,BGPVAL=$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" USER" Q
;BGPN8 - SMOKER OR NOT
D
.I $P(F,U,1)["CURRENT SMOKER"!($P(F,U,1)="CESSATION-SMOKER") S BGPN8=1,BGPVAL=BGPVAL_", "_$P(F,U,2)_" SMOKER" Q
.I BGPSDX]""&(%="") S BGPN8=1,BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($P(BGPSDX,U,2))_" SMOKER" Q
.I $P(BGPSCPT,U)="1034F"!($P(BGPSCPT,U)="G0376")!($P(BGPSCPT,U)="G0375")!($P(BGPSCPT,U)=99407)!($P(BGPSCPT,U)=99406)!($P(BGPSCPT,U)="G8455")!($P(BGPSCPT,U)="G8402")!($P(BGPSCPT,U)="G8453") D
..S BGPN8=1,BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" SMOKER" Q
;BGPN9 - SMOKELESS
D
.I $P(F,U,4)="CURRENT SMOKELESS"!($P(F,U,4)="CURRENT SMOKER & SMOKELESS")!($P(F,U,4)="CESSATION-SMOKELESS") S BGPN9=1,BGPVAL=BGPVAL_", "_$P(F,U,5)_" SMOKELESS" Q
.I $P(BGPSCPT,U)="1035F"!($P(BGPSCPT,U)="G8456") S BGPN9=1,BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" SMOKELESS" Q
;BGPN5 - ETS
I $P(F,U,7)="SMOKER IN HOME"!($P(F,U,7)["ENVIRON") S BGPN10=1,BGPVAL=$S(BGPVAL["SCREEN (20 MONTHS)":BGPVAL_", "_$P(F,U,8)_"ETS",1:$P(BGPTOB,U,8)_" SCREEN (20 MONTHS), ETS")
I BGPN1,BGPVAL="" D
.I BGPTOB]"" S BGPVAL=$S($P(BGPTOB,U,2)]"":$P(BGPTOB,U,2)_" SCREEN",$P(BGPTOB,U,5)]"":$P(BGPTOB,U,5)_" SCREEN (20 MONTHS)",$P(BGPTOB,U,8)]"":$P(BGPTOB,U,8)_" SCREEN (20 MONTHS)",1:"") Q
.I BGPSDX]"" S BGPVAL=$$DATE^BGP1UTL($P(BGPSDX,U,2))_" SCREEN (20 MONTHS)" Q
.I BGPSCPT]"" S BGPVAL=$$DATE^BGP1UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS)" Q
.I BGPXPBD]"" S BGPVAL=$$DATE^BGP1UTL($P(BGPXPBD,U,2))_" SCREEN (20 MONTHS)" Q
.I BGP1320]"" S BGPVAL=$$DATE^BGP1UTL($P(BGP1320,U,2))_" SCREEN (20 MONTHS)" Q
S V=$S(BGPD1:"UP",1:"")_$S(BGPACTCL:",AC",1:"")_$S(BGPD8:",PREG",1:"")
S BGPVALUE=V_"|||"_BGPVAL
Q
BGP1D713 ; IHS/CMI/LAB - measure 31 ;
+1 ;;11.1;IHS CLINICAL REPORTING SYSTEM;;JUN 27, 2011;Build 33
+2 ;
PREGSCRN ;EP
+1 SET BGPTOB=$$TOBHF^BGP1D712(DFN,BGP20M,BGPEDATE)
+2 SET BGPSDX=$$DX^BGP1D7(DFN,BGP20M,BGPEDATE)
+3 SET BGPXPBD=$$PED^BGP1D7(DFN,BGP20M,BGPEDATE)
+4 SET BGP1320=$$DENT^BGP1D7(DFN,BGP20M,BGPEDATE)
+5 SET BGPSCPT=$$CPTSM^BGP1D7(DFN,BGP20M,BGPEDATE)
+6 SET BGPN6=$SELECT(BGPTOB]"":1,1:0)
+7 IF BGPSDX]""
SET BGPN6=1
+8 IF BGPXPBD]""
SET BGPN6=1
+9 IF BGP1320]""
SET BGPN6=1
+10 IF BGPSCPT]""
SET BGPN6=1
+11 SET (BGPVALUE,BGPVAL)=""
+12 SET F=BGPTOB
+13 SET %=""
+14 IF BGPSDX]""
IF $PIECE(BGPSDX,U,1)="305.13"
SET %=1
+15 IF BGPSDX]""
IF $PIECE(BGPSDX,U,1)="V15.82"
SET %=1
+16 ;BGPN7 - USER
+17 Begin DoDot:1
+18 IF $PIECE(F,U,1)["CURRENT"!($PIECE(F,U,1)["CESSATION")
SET BGPN7=1
SET BGPVAL=$PIECE(BGPTOB,U,2)_" SCREEN (20 MONTHS), "_$PIECE(BGPTOB,U,2)_" USER"
QUIT
+19 IF $PIECE(F,U,4)["CURRENT"!($PIECE(F,U,4)["CESSATION")
SET BGPN7=1
SET BGPVAL=$PIECE(BGPTOB,U,2)_" SCREEN (20 MONTHS), "_$PIECE(BGPTOB,U,2)_" USER"
QUIT
+20 IF (BGPSDX]""&(%=""))
SET BGPN7=1
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPSDX,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($PIECE(BGPSDX,U,2))_" USER"
QUIT
+21 IF ($PIECE(BGPSCPT,U)="1034F")!($PIECE(BGPSCPT,U)="1035F")!($PIECE(BGPSCPT,U)="G0376")!($PIECE(BGPSCPT,U)="G0375")!($PIECE(BGPSCPT,U)=99407)
SET BGPN7=1
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" USER"
QUIT
+22 IF $PIECE(BGPSCPT,U)=99406!($PIECE(BGPSCPT,U)="G8455")!($PIECE(BGPSCPT,U)="G8456")!($PIECE(BGPSCPT,U)="G8402")!($PIECE(BGPSCPT,U)="G8453")
SET BGPN7=1
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" USER"
QUIT
End DoDot:1
+23 ;BGPN8 - SMOKER OR NOT
+24 Begin DoDot:1
+25 IF $PIECE(F,U,1)["CURRENT SMOKER"!($PIECE(F,U,1)="CESSATION-SMOKER")
SET BGPN8=1
SET BGPVAL=BGPVAL_", "_$PIECE(F,U,2)_" SMOKER"
QUIT
+26 IF BGPSDX]""&(%="")
SET BGPN8=1
SET BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($PIECE(BGPSDX,U,2))_" SMOKER"
QUIT
+27 IF $PIECE(BGPSCPT,U)="1034F"!($PIECE(BGPSCPT,U)="G0376")!($PIECE(BGPSCPT,U)="G0375")!($PIECE(BGPSCPT,U)=99407)!($PIECE(BGPSCPT,U)=99406)!($PIECE(BGPSCPT,U)="G8455")!($PIECE(BGPSCPT,U)="G8402")!($PIECE(BGPSCPT,U)="G8453")
Begin DoDot:2
+28 SET BGPN8=1
SET BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" SMOKER"
QUIT
End DoDot:2
End DoDot:1
+29 ;BGPN9 - SMOKELESS
+30 Begin DoDot:1
+31 IF $PIECE(F,U,4)="CURRENT SMOKELESS"!($PIECE(F,U,4)="CURRENT SMOKER & SMOKELESS")!($PIECE(F,U,4)="CESSATION-SMOKELESS")
SET BGPN9=1
SET BGPVAL=BGPVAL_", "_$PIECE(F,U,5)_" SMOKELESS"
QUIT
+32 IF $PIECE(BGPSCPT,U)="1035F"!($PIECE(BGPSCPT,U)="G8456")
SET BGPN9=1
SET BGPVAL=BGPVAL_", "_$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" SMOKELESS"
QUIT
End DoDot:1
+33 ;BGPN5 - ETS
+34 IF $PIECE(F,U,7)="SMOKER IN HOME"!($PIECE(F,U,7)["ENVIRON")
SET BGPN10=1
SET BGPVAL=$SELECT(BGPVAL["SCREEN (20 MONTHS)":BGPVAL_", "_$PIECE(F,U,8)_"ETS",1:$PIECE(BGPTOB,U,8)_" SCREEN (20 MONTHS), ETS")
+35 IF BGPN1
IF BGPVAL=""
Begin DoDot:1
+36 IF BGPTOB]""
SET BGPVAL=$SELECT($PIECE(BGPTOB,U,2)]"":$PIECE(BGPTOB,U,2)_" SCREEN",$PIECE(BGPTOB,U,5)]"":$PIECE(BGPTOB,U,5)_" SCREEN (20 MONTHS)",$PIECE(BGPTOB,U,8)]"":$PIECE(BGPTOB,U,8)_" SCREEN (20 MONTHS)",1:"")
QUIT
+37 IF BGPSDX]""
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPSDX,U,2))_" SCREEN (20 MONTHS)"
QUIT
+38 IF BGPSCPT]""
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPSCPT,U,2))_" SCREEN (20 MONTHS)"
QUIT
+39 IF BGPXPBD]""
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGPXPBD,U,2))_" SCREEN (20 MONTHS)"
QUIT
+40 IF BGP1320]""
SET BGPVAL=$$DATE^BGP1UTL($PIECE(BGP1320,U,2))_" SCREEN (20 MONTHS)"
QUIT
End DoDot:1
+41 SET V=$SELECT(BGPD1:"UP",1:"")_$SELECT(BGPACTCL:",AC",1:"")_$SELECT(BGPD8:",PREG",1:"")
+42 SET BGPVALUE=V_"|||"_BGPVAL
+43 QUIT