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

BKMQQCR5.m

Go to the documentation of this file.
BKMQQCR5 ;PRXM/HC/BWF - BKMV Quality of Care Report; [ 1/19/2005  7:16 PM ]
 ;;2.2;HIV MANAGEMENT SYSTEM;;Apr 01, 2015;Build 40
 ; Quality of Care Audit Report
 Q
TOBACCO ; EP - Tobacco Use
 N TOBDT,ICDTAX,ADATAX,HFTAX,HFTAX1,HFTAX2,PTEDTAX,BKMSVTX
 N CLINIC,GL,GL2,GLOBAL,GLOBAL1,GLOBAL2,GLOBAL3,TOTPTS,BKMDFN,TOB
 S TOBDT=$$FMADD^XLFDT(EDATE,-365)
 ;DX.12 Tobacco Users
 S CPTTAX="BGP TOBACCO USER CPTS"
 S ICDTAX="BGP SMOKER ONLY DXS"
 S HFTAX1="BGP TOBACCO USER HLTH FACTORS"
 ;S.4 Tobacco Use Screen
 S CPTTAX1="BGP SMOKING CPTS"
 S ICDTAX1="BGP GPRA SMOKING DXS"
 S HFTAX="BGP TOBACCO SCREEN HLTH FACTOR"
 S ADATAX="BGP TOBACCO CESS DENTAL CODE"
 S PTEDTAX="TO-,-TO,-SHS" ; Tobacco
 S CLINIC=94
 ;ED.5 Tobacco Cessation Counseling (includes ADATAX, PTEDTAX, and CLINIC above)
 S CPTTAX2="BGP TOBACCO CESS CPTS"
 ;DX.7 Non Tobacco Users
 S HFTAX2="BQI NON TOBACCO USER FACTORS"
 S GLOBAL=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOB"",VSTDT,TEST)" ; S.4 Tobacco Use Screen
 S GL=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOB"")"
 S GLOBAL1=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOBUSER"",VSTDT,TEST)" ; DX.12 Tobacco Users
 S GLOBAL2=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOBED"",VSTDT,TEST)" ; ED.5 Tobacco Cessation Counseling
 S GL2=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOBED"")"
 S GLOBAL3=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""TOBNONUSER"",VSTDT,TEST)" ; DX.7 Non Tobacco Users
 S TOTPTS=$P(GLOB,")")_",""HIVCHK"",""TOBTOT"")"
 S @TOTPTS=0,BKMDFN=0
 F  S BKMDFN=$O(@GLOB@("HIVCHK",BKMDFN)) Q:'BKMDFN  D
 .;S.4 and DX.12 and ED.5
 .D ICDTAX^BKMIXX1(BKMDFN,ICDTAX1,EDATE,TOBDT,GLOBAL)
 .;D CPTTAX^BKMIXX(BKMDFN,CPTTAX1,EDATE,TOBDT,GLOBAL)
 .N CPT,EDT,TDT,GBL
 .S CPT=CPTTAX1_$C(29)_CPTTAX_$C(29)_CPTTAX2
 .S EDT=EDATE_$C(29)_EDATE_$C(29)_EDATE
 .;S TDT=TDT_$C(29)_TDT_$C(29)_TDT
 .S TDT=TOBDT_$C(29)_TOBDT_$C(29)_TOBDT
 .S GBL=GLOBAL_$C(29)_GLOBAL1_$C(29)_GLOBAL2
 .D CPTTAX^BKMIXX(BKMDFN,CPT,EDT,TDT,GBL)
 .K CPT,EDT,TDT,GBL
 .D ICDTAX^BKMIXX1(BKMDFN,ICDTAX,EDATE,TOBDT,GLOBAL1)
 .;D CPTTAX^BKMIXX(BKMDFN,CPTTAX,EDATE,TOBDT,GLOBAL1)
 .;ED.5
 .;D CPTTAX^BKMIXX(BKMDFN,CPTTAX2,EDATE,TOBDT,GLOBAL2)
 .; DX.12 only. Include problem list.
 .D PRBTAX^BKMIXX(BKMDFN,ICDTAX,EDATE,TOBDT,GLOBAL1)
 .;S.4 and ED.5
 .D ADATAX^BKMIXX(BKMDFN,ADATAX,EDATE,TOBDT,GLOBAL)
 .;D ADATAX^BKMIXX(BKMDFN,ADATAX,EDATE,TOBDT,GLOBAL2)
 .M @GL2=@GL
 .;S.4 and ED.5
 .D PTEDTAX^BKMIXX(BKMDFN,PTEDTAX,EDATE,TOBDT,GLOBAL,"","","",.BKMSVTX)
 .;D PTEDTAX^BKMIXX(BKMDFN,PTEDTAX,EDATE,TOBDT,GLOBAL2)
 .M @GL2=@GL
 .;S.4 and ED.5
 .D CLNTAX^BKMIXX2(BKMDFN,CLINIC,EDATE,TOBDT,GLOBAL)
 .D CLNTAX^BKMIXX2(BKMDFN,CLINIC,EDATE,TOBDT,GLOBAL2)
 .;S.4
 .D HFTAX^BKMIXX(BKMDFN,HFTAX,EDATE,TOBDT,GLOBAL)
 .;DX.12
 .D HFTAX^BKMIXX(BKMDFN,HFTAX1,EDATE,TOBDT,GLOBAL1)
 .;DX.7
 .D HFTAX^BKMIXX(BKMDFN,HFTAX2,EDATE,TOBDT,GLOBAL3)
 .I $D(@GLOB@("HIVCHK",BKMDFN,"TOB")) S @TOTPTS=@TOTPTS+1
 Q
SUBS01 ; EP - Substance Abuse
 N SUBS01DT,ICDTAX,ICDTAX2,ICDTAX3,HFTAX,PTEDTAX,GLOBAL,GLOBAL1,TOTPTS,BKMDFN,BKMSVTX
 N CD,BHP,BHPRB,MSR
 S SUBS01DT=$$FMADD^XLFDT(EDATE,-365)
 ;S.1
 S CPTTAX="BGP ALCOHOL SCREENING CPTS"
 S ICDTAX="BQI ALCOHOL SCREEN DXS"
 S ICDTAX2="BGP ALCOHOL DXS"
 S PRCTAX="BQI ALCOHOL PROCEDURES"
 S HFTAX="BGP ALCOHOL HLTH FACTOR"
 S PTEDTAX="CD-,-CD,AOD-,-AOD"
 ;S.3
 S ICDTAX3="BKM OTHER SUBSTANCE ABUSE DXS"
 S GLOBAL=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""SUBS01"",VSTDT,TEST)"
 ; IHS does not want Substance Abuse sub-totals originally requested
 ; S GLOBAL1=$P(GLOB,")")_",""HIVCHK"",BKMDFN,""SUBS01CURR"",VSTDT,TEST)"
 S TOTPTS=$P(GLOB,")")_",""HIVCHK"",""SUBS01TOT"")"
 S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