Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BGP8D713

BGP8D713.m

Go to the documentation of this file.
BGP8D713 ; IHS/CMI/LAB - measure 31 ;
 ;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
 ;
PREGSCRN ;EP
 S BGPTOB=$$TOBHF^BGP8D712(DFN,BGP20M,BGPEDATE)  ;get last HF from the 3 categories during the report period
 S BGPSDX=$$DX^BGP8D7(DFN,BGP20M,BGPEDATE)  ;LAST OF ANY SCREENING DX
 S BGPUDX=$$DXU^BGP8D7(DFN,BGP20M,BGPEDATE)  ;last of user dx
 S BGPSMDX=$$DXS^BGP8D7(DFN,BGP20M,BGPEDATE)  ;last of smoking
 S BGPSLDX=$$DXSL^BGP8D7(DFN,BGP20M,BGPEDATE)  ;LAST OF THE SMOKELESS
 S BGPXPHD=$$PED^BGP8D7(DFN,BGP20M,BGPEDATE)
 S BGP1320=$$DENT^BGP8D7(DFN,BGP20M,BGPEDATE)
 S BGPSCPT=$$CPTSM^BGP8D7(DFN,BGP20M,BGPEDATE)
 S BGPN6=$S(BGPTOB]"":1,1:0)
 I BGPSDX]"" S BGPN6=1
 I BGPSLDX]"" S BGPN6=1
 I BGPXPHD]"" S BGPN6=1
 I BGP1320]"" S BGPN6=1
 I BGPSCPT]"" S BGPN6=1
 I BGPUDX]"" S BGPN6=1
 I BGPSMDX]"" S BGPN6=1
 S (BGPVALUE,BGPVAL)=""
 S F=BGPTOB
 S %=""
 S T=$O(^ATXAX("B","BGP TOBACCO PAST USE DXS",0))
 I BGPSDX]"" S I=$P(BGPSDX,U,3) I $$ICD^BGP8UTL2(I,T,9) S %=1
 ;BGPN7 - USER
 D
 .I $P(F,U,1)["CURRENT"!($P(F,U,1)["CESSATION")!($P(F,U,1)["HEAVY TOBACCO SMOKER")!($P(F,U,1)["LIGHT TOBACCO SMOKER") S BGPN7=1,BGPVAL=$P(BGPTOB,U,2)_" SCREEN (20 MONTHS), "_$P(BGPTOB,U,2)_" USER (20 MONTHS)" Q  ;SMOKING CATEGORY
 .I $P(F,U,4)["CURRENT"!($P(F,U,4)["CESSATION") S BGPN7=1,BGPVAL=$P(BGPTOB,U,5)_" SCREEN (20 MONTHS), "_$P(BGPTOB,U,5)_" USER (20 MONTHS)" Q  ;SMOKELESS CATEGORY
 .I $P(F,U,10)["CURRENT"!($P(F,U,10)["CESSATION") S BGPN7=1,BGPVAL=$P(BGPTOB,U,11)_" SCREEN (20 MONTHS), "_$P(BGPTOB,U,11)_" USER (20 MONTHS)" Q  ;ENDS
 .I BGPUDX]"" S BGPN7=1,BGPVAL=$$DATE^BGP8UTL($P(BGPUDX,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP8UTL($P(BGPUDX,U,2))_" USER (20 MONTHS)" Q
 .I BGPSMDX]"" S BGPN7=1,BGPVAL=$$DATE^BGP8UTL($P(BGPSMDX,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP8UTL($P(BGPSMDX,U,2))_" USER (20 MONTHS)" Q
 .I BGPSLDX]"" S BGPN7=1,BGPVAL=$$DATE^BGP8UTL($P(BGPSLDX,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP8UTL($P(BGPSLDX,U,2))_" USER (20 MONTHS)" Q
 .I ($P(BGPSCPT,U)="1034F")!($P(BGPSCPT,U)="1035F")!($P(BGPSCPT,U)="G0376")!($P(BGPSCPT,U)="G0375")!($P(BGPSCPT,U)=99407)!($P(BGPSCPT,U)="G9276") D
 ..S BGPN7=1,BGPVAL=$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" USER (20 MONTHS)" Q
 .I $P(BGPSCPT,U)=99406!($P(BGPSCPT,U)="G8455")!($P(BGPSCPT,U)="G8456")!($P(BGPSCPT,U)="G8402")!($P(BGPSCPT,U)="G8453") D
 ..S BGPN7=1,BGPVAL=$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS), "_$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" USER (20 MONTHS)" Q
 ;BGPN8 - SMOKER OR NOT
 D
 .I $P(F,U,1)["CURRENT SMOKER"!($P(F,U,1)="CESSATION-SMOKER")!($P(F,U,1)["HEAVY TOBACCO SMOKER")!($P(F,U,1)["LIGHT TOBACCO SMOKER") S BGPN8=1,BGPVAL=BGPVAL_", "_$P(F,U,2)_" SMOKER (20 MONTHS)" Q
 .I BGPSMDX]"" S BGPN8=1,BGPVAL=BGPVAL_", "_$$DATE^BGP8UTL($P(BGPSMDX,U,2))_" SMOKER (20 MONTHS)" 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^BGP8UTL($P(BGPSCPT,U,2))_" SMOKER (20 MONTHS)" 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 (20 MONTHS)" Q
 .I $P(BGPSCPT,U)="1035F"!($P(BGPSCPT,U)="G8456") S BGPN9=1,BGPVAL=BGPVAL_", "_$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" SMOKELESS (20 MONTHS)" Q
 .I BGPSLDX]"" S BGPN9=1,BGPVAL=BGPVAL_", "_$$DATE^BGP8UTL($P(BGPSLDX,U,2))_" SMOKELESS (20 MONTHS)" 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 (20 MONTHS)",1:$P(F,U,8)_" SCREEN (20 MONTHS), ETS (20 MONTHS)")
 ;ENDS USER
 D
 .I $P(F,U,10)="CURRENT ENDS USER"!($P(F,U,10)="CESSATION ENDS USER") S BGPN12=1,BGPVAL=BGPVAL_", "_$P(F,U,11)_" ENDS (20 MONTHS)" Q
 I BGPN6,BGPVAL="" D
 .I BGPTOB]"" S BGPVAL=$S($P(BGPTOB,U,2)]"":$P(BGPTOB,U,2)_" SCREEN (20 MONTHS)",$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^BGP8UTL($P(BGPSDX,U,2))_" SCREEN (20 MONTHS)" Q
 .I BGPSCPT]"" S BGPVAL=$$DATE^BGP8UTL($P(BGPSCPT,U,2))_" SCREEN (20 MONTHS)" Q
 .I BGPXPHD]"" S BGPVAL=$$DATE^BGP8UTL($P(BGPXPHD,U,2))_" SCREEN (20 MONTHS)" Q
 .I BGP1320]"" S BGPVAL=$$DATE^BGP8UTL($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