BIREPD2 ;IHS/CMI/MWR - REPORT, ADOLESCENT RATES; DEC 15, 2011
;;8.5;IMMUNIZATION;**5**;JUL 01,2013
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW ADOLESCENT IMMUNIZATION RATES REPORT, GATHER DATA.
; PATCH 1: Clarify Report explanation. START+121
;; PATCH 3: Include new "1-Td 1-Men 3-HPV" lines. START+69
;; PATCH 5: Return Patient Totals for queued reports. START+0
;
;
;----------
HEAD(BIQDT,BIDAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BIUP) ;EP - Header for Adolescent Report.
;---> Produce Header array for Adolescent Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BIDAR (req) Adolescent Report Age Range: "11-18^1" (years).
; 3 - BIAGRPS (req) String of Age Groups ("1112,1313,1317").
; 4 - BICC (req) Current Community array.
; 5 - BIHCF (req) Health Care Facility array.
; 6 - BICM (req) Case Manager array.
; 7 - BIBEN (req) Beneficiary Type array.
; 8 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
;
;---> Check for required Variables.
Q:'$G(BIQDT)
Q:'$D(BICC)
Q:'$D(BIHCF)
Q:'$D(BICM)
Q:'$D(BIBEN)
Q:'$D(BIDAR)
Q:'$G(BIAGRPS)
Q:'$D(BIUP)
;
K VALMHDR
N BILINE,X,Y S BILINE=0
;
S X=""
;---> If Header array is NOT being for Listmananger include version.
S:'$D(VALM("BM")) X=$$LMVER^BILOGO()
;
D WH^BIW(.BILINE,X)
S X=$$REPHDR^BIUTL6(DUZ(2)) D CENTERT^BIUTL5(.X)
D WH^BIW(.BILINE,X)
;
S X="* Adolescent Immunization Report (11-17 yrs) *" D CENTERT^BIUTL5(.X)
D WH^BIW(.BILINE,X)
;
S X=$$SP^BIUTL5(27)_"Report Date: "_$$SLDT1^BIUTL5(DT)
D WH^BIW(.BILINE,X)
;
S X=$$SP^BIUTL5(30)_"End Date: "_$$SLDT1^BIUTL5(BIQDT)
D WH^BIW(.BILINE,X,1)
;
S X=" "_$$BIUPTX^BIUTL6(BIUP)
I BIUP="i" S X=" "_$$BIUPTX^BIUTL6(BIUP,1)_" (Active)"
S X=$$PAD^BIUTL5(X,34)
;
S Y="Total Patients: "_$G(BITOTPTS)_" (F:"_$G(BITOTFPT)_" M:"_$G(BITOTMPT)_")"
S X=X_$J(Y,45)
D WH^BIW(.BILINE,X)
S X=$$SP^BIUTL5(79,"-")
D WH^BIW(.BILINE,X)
;
D
.;---> If specific Communities were selected (not ALL), then print
.;---> the Communities in a subheader at the top of the report.
.D SUBH^BIOUTPT5("BICC","Community",,"^AUTTCOM(",.BILINE,.BIERR,,12)
.I $G(BIERR) D ERRCD^BIUTL2(BIERR,.X) D WH^BIW(.BILINE,X) Q
.;
.;---> If specific Health Care Facilities, print subheader.
.D SUBH^BIOUTPT5("BIHCF","Facility",,"^DIC(4,",.BILINE,.BIERR,,12)
.I $G(BIERR) D ERRCD^BIUTL2(BIERR,.X) D WH^BIW(.BILINE,X) Q
.;
.;---> If specific Case Managers, print Case Manager subheader.
.D SUBH^BIOUTPT5("BICM","Case Manager",,"^VA(200,",.BILINE,.BIERR,,12)
.I $G(BIERR) D ERRCD^BIUTL2(BIERR,.X) D WH^BIW(.BILINE,X) Q
.;
.;---> If specific Beneficiary Types, print Beneficiary Type subheader.
.D SUBH^BIOUTPT5("BIBEN","Beneficiary Type",,"^AUTTBEN(",.BILINE,.BIERR,,12)
.I $G(BIERR) D ERRCD^BIUTL2(BIERR,.X) D WH^BIW(.BILINE,X) Q
.;
.;---> Now write Age Group Denominators subheader.
.S X=" Age Group | 11-12yrs 13yrs 13-17yrs"
.D WH^BIW(.BILINE,X)
.S X=" Denominators | "_$J($G(BITOTPTS(1112)),7)_" "
.S X=X_$J($G(BITOTPTS(1313)),7)_" "_$J($G(BITOTPTS(1317)),7)
.D WH^BIW(.BILINE,X)
;
;---> If Header array is being built for Listmananger,
;---> reset display window margins for Communities, etc.
D:$D(VALM("BM"))
.S VALM("TM")=BILINE+3
.S VALM("LINES")=VALM("BM")-VALM("TM")+1
.;---> Safeguard to prevent divide/0 error.
.S:VALM("LINES")<1 VALM("LINES")=1
Q
;
;
;----------
START(BIQDT,BIDAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BISITE,BIUP,BITOTPTS,BITOTFPT,BITOTMPT) ;EP
;---> Produce array for Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BIDAR (opt) Adolescent Report Age Range: "11-18^1" (years).
; 3 - BIAGRPS (req) String of Age Groups ("1112,1313,1317").
; 4 - BICC (req) Current Community array.
; 5 - BIHCF (req) Health Care Facility array.
; 6 - BICM (req) Case Manager array.
; 7 - BIBEN (req) Beneficiary Type array.
; 8 - BISITE (req) Site IEN.
; 9 - BIUP (req) User Population/Group (All, Imm, User, Active).
; 10 - BITOTPTS (ret) Total Patients.
; 11 - BITOTFPT (ret) Total Female Patients.
; 12 - BITOTmPT (ret) Total Male Patients.
;
K ^TMP("BIREPD1",$J)
N BILINE,BITMP,X S BILINE=0
;
;---> Check for required Variables.
I '$G(BIQDT) D ERRCD^BIUTL2(623,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$D(BIDAR) D ERRCD^BIUTL2(613,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$G(BIAGRPS) D ERRCD^BIUTL2(677,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$D(BICC) D ERRCD^BIUTL2(614,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$D(BIHCF) D ERRCD^BIUTL2(625,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$D(BICM) D ERRCD^BIUTL2(615,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$D(BIBEN) D ERRCD^BIUTL2(662,.X) D WRITE^BIREPD3(.BILINE,X) Q
I '$G(BISITE) S BISITE=$G(DUZ(2))
I '$G(BISITE) D ERRCD^BIUTL2(109,.X) D WRITE^BIREPD3(.BILINE,X) Q
S:$G(BIUP)="" BIUP="u"
;
;---> Gather data.
D GETDATA^BIREPD3(.BICC,.BIHCF,.BICM,.BIBEN,BIQDT,BIDAR,BIAGRPS,BISITE,BIUP,.BITMP,.BIERR)
I $G(BIERR)]"" D WRITE^BIREPD3(.BILINE,BIERR) Q
;
;
;---> BITOTPTS variables (total patients) not newed here because they are
;---> also used in the Report Header.
;---> Total.
S BITOTPTS=+$G(BITMP("STATS","TOTLPTS"))
S BITOTPTS(1112)=+$G(BITMP("STATS","TOTLPTS",1112))
S BITOTPTS(1313)=+$G(BITMP("STATS","TOTLPTS",1313))
S BITOTPTS(1317)=+$G(BITMP("STATS","TOTLPTS",1317))
;---> Females.
S BITOTFPT=+$G(BITMP("STATS","TOTLFPTS"))
S BITOTFPT(1112)=+$G(BITMP("STATS","TOTLFPTS",1112))
S BITOTFPT(1313)=+$G(BITMP("STATS","TOTLFPTS",1313))
S BITOTFPT(1317)=+$G(BITMP("STATS","TOTLFPTS",1317))
;---> Males.
S BITOTMPT=+$G(BITMP("STATS","TOTLMPTS"))
S BITOTMPT(1112)=+$G(BITMP("STATS","TOTLMPTS",1112))
S BITOTMPT(1313)=+$G(BITMP("STATS","TOTLMPTS",1313))
S BITOTMPT(1317)=+$G(BITMP("STATS","TOTLMPTS",1317))
;
;
;---> VACCINE GROUPS
;---> Write Statistics lines for each Vaccine Group (BIVGRP).
;---> NOTE: 132 is specific for Var-Hx of Chickenpox.
;---> 221 is for the specific vaccine Tdap.
F BIVGRP=4,6,7,132,221,8,9,16,10 D VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,,.BIERR)
I $G(BIERR)]"" D WRITE^BIREPD3(.BILINE,BIERR) Q
;
;
;---> VACCINE COMBINATIONS
;---> Write Statistics lines for each Vaccine Combinations.
;---> NOTE: These Combo strings are also used to set BITMP("STATS"
;---> nodes beginning at +130^BIREPD4.
;
D VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^7|1",BIAGRPS,.BITMP,,.BIERR)
D VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2",BIAGRPS,.BITMP,,.BIERR)
D VCOMB^BIREPD3(.BILINE,"8|1^16|1",BIAGRPS,.BITMP,,.BIERR)
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Include new "1-Td 1-Men 3-HPV" line for both sexes.
D VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"B",.BIERR)
;**********
;
;*******
;---> Break to write FEMALE Denominators subheader.
D DENOMS(.BILINE,.BITOTFPT,1)
;
;---> Write Female Statistics lines for HPV Vaccine Group (BIVGRP=17-HPV).
F BIVGRP=17 D VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,"F",.BIERR)
I $G(BIERR)]"" D WRITE^BIREPD3(.BILINE,BIERR) Q
;
;---> Now write FEMALE combos.
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Add "1-Td 1-Men 3-HPV" combo line for females.
D VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"F",.BIERR)
;**********
;
D VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2^17|3",BIAGRPS,.BITMP,"F",.BIERR)
;*******
;
;---> Break to write MALE Denominators subheader.
D DENOMS(.BILINE,.BITOTMPT,0)
;
;---> Write Male Statistics lines for HPV Vaccine Group (BIVGRP=17-HPV).
F BIVGRP=17 D VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,"M",.BIERR)
I $G(BIERR)]"" D WRITE^BIREPD3(.BILINE,BIERR) Q
;
;---> Now write MALE combos.
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Add "1-Td 1-Men 3-HPV" combo line for males.
D VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"M",.BIERR)
;**********
;
D VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2^17|3",BIAGRPS,.BITMP,"M",.BIERR)
;*******
;
I $G(BIERR)]"" D WRITE^BIREPD3(.BILINE,BIERR) Q
;
;---> Finish off report with totals lines at the bottom.
S X=" Total Patients reviewed: "_BITOTPTS
S X=X_" Females: "_BITOTFPT_" Males: "_BITOTMPT
D WRITE^BIREPD3(.BILINE,X)
;D WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
;
;---> Now write total patients considered who had refusals.
N M,N S (M,N)=0 F S M=$O(BITMP("REFUSALS",M)) Q:'M S N=N+1
S X=" Total Patients reviewed who had Refusals on record: "_N
D WRITE^BIREPD3(.BILINE,X),WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
;
D
.I BIUP="r" S X="all Registered Patients who have an active health record." Q
.I BIUP="i" S X="Immunization Register Patients with a status of Active." Q
.I BIUP="u" S X="the User Population patients: 1 visit in the past 3 years." Q
.I BIUP="a" S X="Active Clinical Users: 2 clinical visits in the past 3 years." Q
;
S X=" *Denominators are "_X
D WRITE^BIREPD3(.BILINE,X)
;
;********** PATCH 1, v8.5, JAN 03,2012, IHS/CMI/MWR
;---> Change text of explanation.
;S X=" *All patients (11-17yrs) with 1-Tdap_TD and 1-Mening are considered ""Current."""
;D WRITE^BIREPD3(.BILINE,X)
;S X=" *Patients 11-12yrs without 1-Tdap_TD and 1-Mening are listed as ""Not Current"""
;S X=" in order to support patient recall."
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Update "Current" explanation to include 3-HPV.
;S X=" *All patients (11-17yrs) with 1-Tdap_TD and 1-Mening are considered ""Current"";"
S X=" *All patients (11-17yrs) with 1-TD_B, 1-MEN, 3-HPV are considered ""Current"";"
;**********
;
D WRITE^BIREPD3(.BILINE,X)
S X=" otherwise they are listed as ""Not Current"" in order to support patient recall."
;
D WRITE^BIREPD3(.BILINE,X)
D WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
;
;---> Set final VALMCNT (Listman line count).
S VALMCNT=BILINE
Q
;
;
;----------
DENOMS(BILINE,BITOTSPT,Z) ;EP
;---> Produce Female and Male Denominators subheader.
;---> Parameters:
; 1 - BILINE (req) Line number in ^TMP Listman array.
; 2 - BITOTSPT (req) By Sex Total Patients-Age Group-Stats array.
; 3 - Z (req) If Z=1, then female; Z=0, then male.
;
;---> Break to write Female or Male Denominators subheader.
S X=$S(Z:" Female",1:" Male")
S X=X_" | 11-12yrs 13yrs 13-17yrs"
D WRITE^BIREPD3(.BILINE,X)
S X=" Denominators | "_$J($G(BITOTSPT(1112)),7)_" "
S X=X_$J($G(BITOTSPT(1313)),7)_" "_$J($G(BITOTSPT(1317)),7)
D WRITE^BIREPD3(.BILINE,X)
D WRITE^BIREPD3(.BILINE," "_$$SP^BIUTL5(63,"-"))
Q
BIREPD2 ;IHS/CMI/MWR - REPORT, ADOLESCENT RATES; DEC 15, 2011
+1 ;;8.5;IMMUNIZATION;**5**;JUL 01,2013
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW ADOLESCENT IMMUNIZATION RATES REPORT, GATHER DATA.
+4 ; PATCH 1: Clarify Report explanation. START+121
+5 ;; PATCH 3: Include new "1-Td 1-Men 3-HPV" lines. START+69
+6 ;; PATCH 5: Return Patient Totals for queued reports. START+0
+7 ;
+8 ;
+9 ;----------
HEAD(BIQDT,BIDAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BIUP) ;EP - Header for Adolescent Report.
+1 ;---> Produce Header array for Adolescent Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BIDAR (req) Adolescent Report Age Range: "11-18^1" (years).
+5 ; 3 - BIAGRPS (req) String of Age Groups ("1112,1313,1317").
+6 ; 4 - BICC (req) Current Community array.
+7 ; 5 - BIHCF (req) Health Care Facility array.
+8 ; 6 - BICM (req) Case Manager array.
+9 ; 7 - BIBEN (req) Beneficiary Type array.
+10 ; 8 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
+11 ;
+12 ;---> Check for required Variables.
+13 IF '$GET(BIQDT)
QUIT
+14 IF '$DATA(BICC)
QUIT
+15 IF '$DATA(BIHCF)
QUIT
+16 IF '$DATA(BICM)
QUIT
+17 IF '$DATA(BIBEN)
QUIT
+18 IF '$DATA(BIDAR)
QUIT
+19 IF '$GET(BIAGRPS)
QUIT
+20 IF '$DATA(BIUP)
QUIT
+21 ;
+22 KILL VALMHDR
+23 NEW BILINE,X,Y
SET BILINE=0
+24 ;
+25 SET X=""
+26 ;---> If Header array is NOT being for Listmananger include version.
+27 IF '$DATA(VALM("BM"))
SET X=$$LMVER^BILOGO()
+28 ;
+29 DO WH^BIW(.BILINE,X)
+30 SET X=$$REPHDR^BIUTL6(DUZ(2))
DO CENTERT^BIUTL5(.X)
+31 DO WH^BIW(.BILINE,X)
+32 ;
+33 SET X="* Adolescent Immunization Report (11-17 yrs) *"
DO CENTERT^BIUTL5(.X)
+34 DO WH^BIW(.BILINE,X)
+35 ;
+36 SET X=$$SP^BIUTL5(27)_"Report Date: "_$$SLDT1^BIUTL5(DT)
+37 DO WH^BIW(.BILINE,X)
+38 ;
+39 SET X=$$SP^BIUTL5(30)_"End Date: "_$$SLDT1^BIUTL5(BIQDT)
+40 DO WH^BIW(.BILINE,X,1)
+41 ;
+42 SET X=" "_$$BIUPTX^BIUTL6(BIUP)
+43 IF BIUP="i"
SET X=" "_$$BIUPTX^BIUTL6(BIUP,1)_" (Active)"
+44 SET X=$$PAD^BIUTL5(X,34)
+45 ;
+46 SET Y="Total Patients: "_$GET(BITOTPTS)_" (F:"_$GET(BITOTFPT)_" M:"_$GET(BITOTMPT)_")"
+47 SET X=X_$JUSTIFY(Y,45)
+48 DO WH^BIW(.BILINE,X)
+49 SET X=$$SP^BIUTL5(79,"-")
+50 DO WH^BIW(.BILINE,X)
+51 ;
+52 Begin DoDot:1
+53 ;---> If specific Communities were selected (not ALL), then print
+54 ;---> the Communities in a subheader at the top of the report.
+55 DO SUBH^BIOUTPT5("BICC","Community",,"^AUTTCOM(",.BILINE,.BIERR,,12)
+56 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+57 ;
+58 ;---> If specific Health Care Facilities, print subheader.
+59 DO SUBH^BIOUTPT5("BIHCF","Facility",,"^DIC(4,",.BILINE,.BIERR,,12)
+60 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+61 ;
+62 ;---> If specific Case Managers, print Case Manager subheader.
+63 DO SUBH^BIOUTPT5("BICM","Case Manager",,"^VA(200,",.BILINE,.BIERR,,12)
+64 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+65 ;
+66 ;---> If specific Beneficiary Types, print Beneficiary Type subheader.
+67 DO SUBH^BIOUTPT5("BIBEN","Beneficiary Type",,"^AUTTBEN(",.BILINE,.BIERR,,12)
+68 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+69 ;
+70 ;---> Now write Age Group Denominators subheader.
+71 SET X=" Age Group | 11-12yrs 13yrs 13-17yrs"
+72 DO WH^BIW(.BILINE,X)
+73 SET X=" Denominators | "_$JUSTIFY($GET(BITOTPTS(1112)),7)_" "
+74 SET X=X_$JUSTIFY($GET(BITOTPTS(1313)),7)_" "_$JUSTIFY($GET(BITOTPTS(1317)),7)
+75 DO WH^BIW(.BILINE,X)
End DoDot:1
+76 ;
+77 ;---> If Header array is being built for Listmananger,
+78 ;---> reset display window margins for Communities, etc.
+79 IF $DATA(VALM("BM"))
Begin DoDot:1
+80 SET VALM("TM")=BILINE+3
+81 SET VALM("LINES")=VALM("BM")-VALM("TM")+1
+82 ;---> Safeguard to prevent divide/0 error.
+83 IF VALM("LINES")<1
SET VALM("LINES")=1
End DoDot:1
+84 QUIT
+85 ;
+86 ;
+87 ;----------
START(BIQDT,BIDAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BISITE,BIUP,BITOTPTS,BITOTFPT,BITOTMPT) ;EP
+1 ;---> Produce array for Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BIDAR (opt) Adolescent Report Age Range: "11-18^1" (years).
+5 ; 3 - BIAGRPS (req) String of Age Groups ("1112,1313,1317").
+6 ; 4 - BICC (req) Current Community array.
+7 ; 5 - BIHCF (req) Health Care Facility array.
+8 ; 6 - BICM (req) Case Manager array.
+9 ; 7 - BIBEN (req) Beneficiary Type array.
+10 ; 8 - BISITE (req) Site IEN.
+11 ; 9 - BIUP (req) User Population/Group (All, Imm, User, Active).
+12 ; 10 - BITOTPTS (ret) Total Patients.
+13 ; 11 - BITOTFPT (ret) Total Female Patients.
+14 ; 12 - BITOTmPT (ret) Total Male Patients.
+15 ;
+16 KILL ^TMP("BIREPD1",$JOB)
+17 NEW BILINE,BITMP,X
SET BILINE=0
+18 ;
+19 ;---> Check for required Variables.
+20 IF '$GET(BIQDT)
DO ERRCD^BIUTL2(623,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+21 IF '$DATA(BIDAR)
DO ERRCD^BIUTL2(613,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+22 IF '$GET(BIAGRPS)
DO ERRCD^BIUTL2(677,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+23 IF '$DATA(BICC)
DO ERRCD^BIUTL2(614,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+24 IF '$DATA(BIHCF)
DO ERRCD^BIUTL2(625,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+25 IF '$DATA(BICM)
DO ERRCD^BIUTL2(615,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+26 IF '$DATA(BIBEN)
DO ERRCD^BIUTL2(662,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+27 IF '$GET(BISITE)
SET BISITE=$GET(DUZ(2))
+28 IF '$GET(BISITE)
DO ERRCD^BIUTL2(109,.X)
DO WRITE^BIREPD3(.BILINE,X)
QUIT
+29 IF $GET(BIUP)=""
SET BIUP="u"
+30 ;
+31 ;---> Gather data.
+32 DO GETDATA^BIREPD3(.BICC,.BIHCF,.BICM,.BIBEN,BIQDT,BIDAR,BIAGRPS,BISITE,BIUP,.BITMP,.BIERR)
+33 IF $GET(BIERR)]""
DO WRITE^BIREPD3(.BILINE,BIERR)
QUIT
+34 ;
+35 ;
+36 ;---> BITOTPTS variables (total patients) not newed here because they are
+37 ;---> also used in the Report Header.
+38 ;---> Total.
+39 SET BITOTPTS=+$GET(BITMP("STATS","TOTLPTS"))
+40 SET BITOTPTS(1112)=+$GET(BITMP("STATS","TOTLPTS",1112))
+41 SET BITOTPTS(1313)=+$GET(BITMP("STATS","TOTLPTS",1313))
+42 SET BITOTPTS(1317)=+$GET(BITMP("STATS","TOTLPTS",1317))
+43 ;---> Females.
+44 SET BITOTFPT=+$GET(BITMP("STATS","TOTLFPTS"))
+45 SET BITOTFPT(1112)=+$GET(BITMP("STATS","TOTLFPTS",1112))
+46 SET BITOTFPT(1313)=+$GET(BITMP("STATS","TOTLFPTS",1313))
+47 SET BITOTFPT(1317)=+$GET(BITMP("STATS","TOTLFPTS",1317))
+48 ;---> Males.
+49 SET BITOTMPT=+$GET(BITMP("STATS","TOTLMPTS"))
+50 SET BITOTMPT(1112)=+$GET(BITMP("STATS","TOTLMPTS",1112))
+51 SET BITOTMPT(1313)=+$GET(BITMP("STATS","TOTLMPTS",1313))
+52 SET BITOTMPT(1317)=+$GET(BITMP("STATS","TOTLMPTS",1317))
+53 ;
+54 ;
+55 ;---> VACCINE GROUPS
+56 ;---> Write Statistics lines for each Vaccine Group (BIVGRP).
+57 ;---> NOTE: 132 is specific for Var-Hx of Chickenpox.
+58 ;---> 221 is for the specific vaccine Tdap.
+59 FOR BIVGRP=4,6,7,132,221,8,9,16,10
DO VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,,.BIERR)
+60 IF $GET(BIERR)]""
DO WRITE^BIREPD3(.BILINE,BIERR)
QUIT
+61 ;
+62 ;
+63 ;---> VACCINE COMBINATIONS
+64 ;---> Write Statistics lines for each Vaccine Combinations.
+65 ;---> NOTE: These Combo strings are also used to set BITMP("STATS"
+66 ;---> nodes beginning at +130^BIREPD4.
+67 ;
+68 DO VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^7|1",BIAGRPS,.BITMP,,.BIERR)
+69 DO VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2",BIAGRPS,.BITMP,,.BIERR)
+70 DO VCOMB^BIREPD3(.BILINE,"8|1^16|1",BIAGRPS,.BITMP,,.BIERR)
+71 ;
+72 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+73 ;---> Include new "1-Td 1-Men 3-HPV" line for both sexes.
+74 DO VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"B",.BIERR)
+75 ;**********
+76 ;
+77 ;*******
+78 ;---> Break to write FEMALE Denominators subheader.
+79 DO DENOMS(.BILINE,.BITOTFPT,1)
+80 ;
+81 ;---> Write Female Statistics lines for HPV Vaccine Group (BIVGRP=17-HPV).
+82 FOR BIVGRP=17
DO VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,"F",.BIERR)
+83 IF $GET(BIERR)]""
DO WRITE^BIREPD3(.BILINE,BIERR)
QUIT
+84 ;
+85 ;---> Now write FEMALE combos.
+86 ;
+87 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+88 ;---> Add "1-Td 1-Men 3-HPV" combo line for females.
+89 DO VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"F",.BIERR)
+90 ;**********
+91 ;
+92 DO VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2^17|3",BIAGRPS,.BITMP,"F",.BIERR)
+93 ;*******
+94 ;
+95 ;---> Break to write MALE Denominators subheader.
+96 DO DENOMS(.BILINE,.BITOTMPT,0)
+97 ;
+98 ;---> Write Male Statistics lines for HPV Vaccine Group (BIVGRP=17-HPV).
+99 FOR BIVGRP=17
DO VGRP^BIREPD3(.BILINE,BIVGRP,BIAGRPS,.BITMP,"M",.BIERR)
+100 IF $GET(BIERR)]""
DO WRITE^BIREPD3(.BILINE,BIERR)
QUIT
+101 ;
+102 ;---> Now write MALE combos.
+103 ;
+104 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+105 ;---> Add "1-Td 1-Men 3-HPV" combo line for males.
+106 DO VCOMB^BIREPD3(.BILINE,"8|1^16|1^17|3",BIAGRPS,.BITMP,"M",.BIERR)
+107 ;**********
+108 ;
+109 DO VCOMB^BIREPD3(.BILINE,"8|1^4|3^6|2^16|1^7|2^17|3",BIAGRPS,.BITMP,"M",.BIERR)
+110 ;*******
+111 ;
+112 IF $GET(BIERR)]""
DO WRITE^BIREPD3(.BILINE,BIERR)
QUIT
+113 ;
+114 ;---> Finish off report with totals lines at the bottom.
+115 SET X=" Total Patients reviewed: "_BITOTPTS
+116 SET X=X_" Females: "_BITOTFPT_" Males: "_BITOTMPT
+117 DO WRITE^BIREPD3(.BILINE,X)
+118 ;D WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
+119 ;
+120 ;---> Now write total patients considered who had refusals.
+121 NEW M,N
SET (M,N)=0
FOR
SET M=$ORDER(BITMP("REFUSALS",M))
IF 'M
QUIT
SET N=N+1
+122 SET X=" Total Patients reviewed who had Refusals on record: "_N
+123 DO WRITE^BIREPD3(.BILINE,X)
DO WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
+124 ;
+125 Begin DoDot:1
+126 IF BIUP="r"
SET X="all Registered Patients who have an active health record."
QUIT
+127 IF BIUP="i"
SET X="Immunization Register Patients with a status of Active."
QUIT
+128 IF BIUP="u"
SET X="the User Population patients: 1 visit in the past 3 years."
QUIT
+129 IF BIUP="a"
SET X="Active Clinical Users: 2 clinical visits in the past 3 years."
QUIT
End DoDot:1
+130 ;
+131 SET X=" *Denominators are "_X
+132 DO WRITE^BIREPD3(.BILINE,X)
+133 ;
+134 ;********** PATCH 1, v8.5, JAN 03,2012, IHS/CMI/MWR
+135 ;---> Change text of explanation.
+136 ;S X=" *All patients (11-17yrs) with 1-Tdap_TD and 1-Mening are considered ""Current."""
+137 ;D WRITE^BIREPD3(.BILINE,X)
+138 ;S X=" *Patients 11-12yrs without 1-Tdap_TD and 1-Mening are listed as ""Not Current"""
+139 ;S X=" in order to support patient recall."
+140 ;
+141 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+142 ;---> Update "Current" explanation to include 3-HPV.
+143 ;S X=" *All patients (11-17yrs) with 1-Tdap_TD and 1-Mening are considered ""Current"";"
+144 SET X=" *All patients (11-17yrs) with 1-TD_B, 1-MEN, 3-HPV are considered ""Current"";"
+145 ;**********
+146 ;
+147 DO WRITE^BIREPD3(.BILINE,X)
+148 SET X=" otherwise they are listed as ""Not Current"" in order to support patient recall."
+149 ;
+150 DO WRITE^BIREPD3(.BILINE,X)
+151 DO WRITE^BIREPD3(.BILINE,$$SP^BIUTL5(79,"-"))
+152 ;
+153 ;---> Set final VALMCNT (Listman line count).
+154 SET VALMCNT=BILINE
+155 QUIT
+156 ;
+157 ;
+158 ;----------
DENOMS(BILINE,BITOTSPT,Z) ;EP
+1 ;---> Produce Female and Male Denominators subheader.
+2 ;---> Parameters:
+3 ; 1 - BILINE (req) Line number in ^TMP Listman array.
+4 ; 2 - BITOTSPT (req) By Sex Total Patients-Age Group-Stats array.
+5 ; 3 - Z (req) If Z=1, then female; Z=0, then male.
+6 ;
+7 ;---> Break to write Female or Male Denominators subheader.
+8 SET X=$SELECT(Z:" Female",1:" Male")
+9 SET X=X_" | 11-12yrs 13yrs 13-17yrs"
+10 DO WRITE^BIREPD3(.BILINE,X)
+11 SET X=" Denominators | "_$JUSTIFY($GET(BITOTSPT(1112)),7)_" "
+12 SET X=X_$JUSTIFY($GET(BITOTSPT(1313)),7)_" "_$JUSTIFY($GET(BITOTSPT(1317)),7)
+13 DO WRITE^BIREPD3(.BILINE,X)
+14 DO WRITE^BIREPD3(.BILINE," "_$$SP^BIUTL5(63,"-"))
+15 QUIT