BIREPL2 ;IHS/CMI/MWR - REPORT, ADULT IMM; MAY 10, 2010
;;8.5;IMMUNIZATION;**12**;MAY 01,2016
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW ADULT IMMUNIZATION REPORT, GATHER DATA.
;; PATCH 3: Remove Date Range line (no longer relevant). HEAD+33
;; PATCH 3: Set HPV upper limit display for males to 21 years. DISPLAY+69
;; PATCH 12: Add new Composite Measures. DISPLAY+25
;
;
;----------
HEAD(BIQDT,BICC,BIHCF,BIBEN,BICPTI,BIUP) ;EP
;---> Produce Header array for ADULT Immunization Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BICC (req) Current Community array.
; 3 - BIHCF (req) Health Care Facility array.
; 4 - BIBEN (req) Beneficiary Type array.
; 5 - BICPTI (req) 1=Include CPT Coded Visits, 0=Ignore CPT
; 6 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
;
;---> Check for required Variables.
Q:'$G(BIQDT)
Q:'$D(BICC)
Q:'$D(BIHCF)
Q:'$D(BIBEN)
I '$D(BICPTI) S BICPTI=0
Q:'$D(BIUP)
;
K VALMHDR
N BILINE,X S BILINE=0
;
N X 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="* Adult Immunization Report *" D CENTERT^BIUTL5(.X)
D WH^BIW(.BILINE,X)
;
S X=$$SP^BIUTL5(27)_"Report Date: "_$$SLDT1^BIUTL5(DT)
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Remove Date Range line (no longer relevant).
;D WH^BIW(.BILINE,X)
D WH^BIW(.BILINE,X,1)
;
;S X=$$SP^BIUTL5(28)_"Date Range: "_$$SLDT1^BIUTL5(BIQDT-10000)_" - "_$$SLDT1^BIUTL5(BIQDT)
;D WH^BIW(.BILINE,X,1)
;**********
;
S X=" "_$$BIUPTX^BIUTL6(BIUP)
I BICPTI S X=$$PAD^BIUTL5(X,52)_"* CPT Coded Visits Included"
D WH^BIW(.BILINE,X)
D WH^BIW(.BILINE,$$SP^BIUTL5(79,"-"))
;
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,,13)
.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,,13)
.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,,13)
.I $G(BIERR) D ERRCD^BIUTL2(BIERR,.X) D WH^BIW(.BILINE,X) Q
.;
.S X=$$SP^BIUTL5(59)_"Number Percent"
.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,BICC,BIHCF,BIBEN,BICPTI,BIUP) ;EP
;---> Produce array for ADULT Immunization Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BICC (req) Current Community array.
; 3 - BIHCF (req) Health Care Facility array.
; 4 - BIBEN (req) Beneficiary Type array.
; 5 - BICPTI (req) 1=Include CPT Coded Visits, 0=Ignore CPT (default).
; 6 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
;
N BILINE,BITMP,X S BILINE=0
K ^TMP("BIREPL1",$J)
;
;---> Check for required Variables.
;---> Fix for v8.1 by adding .X to error calls below.
I '$G(BIQDT) D ERRCD^BIUTL2(623,.X) D WRITE(.BILINE,X) Q
I '$D(BICC) D ERRCD^BIUTL2(614,.X) D WRITE(.BILINE,X) Q
I '$D(BIHCF) D ERRCD^BIUTL2(625,.X) D WRITE(.BILINE,X) Q
I '$D(BIBEN) D ERRCD^BIUTL2(662,.X) D WRITE(.BILINE,X) Q
I '$D(BICPTI) S BICPTI=0
S:$G(BIUP)="" BIUP="u"
;
D GETSTATS^BIREPL3(BIQDT,.BICC,.BIHCF,.BIBEN,BICPTI,BIUP,.BITOTS)
D DISPLAY(BITOTS,.BILINE)
S VALMCNT=BILINE
Q
;
;
;----------
DISPLAY(BITOTS,BILINE) ;EP
;---> Write Adult Stats for display.
;---> Parameters:
; 1 - BITOTS (req) Totals delimited by "^":
; Pc Variable
; 1 - BI19=Total over 19
; 2 - BIT19 = Number over 19 w/Tetanus past 10 years.
; 3 - BITDAP = Number over 19 w/Tdap past 10 years.
;
; 4 - BIHPVF = Total number of Females age 19-26
; 5 - BIHPVF1 = Number Females 19-26 w/HPV-1
; 6 - BIHPVF2 = Number Females 19-26 w/HPV-2
; 7 - BIHPVF3 = Number Females 19-26 w/HPV-3
; 8 - BIHPVF = Total number of Males age 19-26
; 9 - BIHPVM1 = Number Males 19-26 w/HPV-1
; 10 - BIHPVM2 = Number Males 19-26 w/HPV-2
; 11 - BIHPVM3 = Number Males 19-26 w/HPV-3
;
; 12 - BI60=Total over 60
; 13 - BIZ60 = Number over 60 w/Zoster ever.
; 14 - BI65=Total over 65
; 15 - BIT65 = Number over 65 w/Tetanus past 10 years.
; 16 - BIP65 = Number over 65 w/Pneumo at or after 65 years.
; 17 - BIP65E = Number over 65 w/Pneumo EVER.
;
;********** PATCH 12, v8.5, MAY 01,2016, IHS/CMI/MWR
;---> New Composite Measure Variables.
; 18 - BIC19=Total >19 <60
; 19 - BIC191=Tdap ever
; 20 - BIC192=(Td or Tdap) <10 yrs
; 21 - BIC193=(Tdap ever) AND ((Tdap or Td) <10 yrs)
;
; 22 - BIC60=Total >60 <65
; 23 - BIC601=Tdap ever
; 24 - BIC602=(Td or Tdap) <10 yrs
; 25 - BIC603=Zoster
; 26 - BIC604=(Tdap ever) AND ((Tdap or Td) <10 yrs) AND Zoster
;
; 27 - BIC65=Total >65
; 28 - BIC651=Tdap ever
; 29 - BIC652=(Td or Tdap) <10 yrs
; 30 - BIC653=Zoster
; 31 - BIC654=Pneumo >65 yrs
; 32 - BIC655=(Tdap ever) AND ((Tdap or Td) <10 yrs) AND Zoster AND Pneumo
; 33 - BICUTDD=Overall UTD Denominator
; 34 - BICUTDN-Overall UTD Numerator
;
;
; 1 - BILINE (ret) Number of lines written to Listman scroll area.
;
I $G(BITOTS)="" D ERRCD^BIUTL2(667,.X) D WRITE(.BILINE,X) Q
;
;---> Set totals into BIV local array, 1-15.
;**********
;N BIV,I F I=1:1:17 S BIV(I)=$P(BITOTS,U,I)
N BIV,I F I=1:1:34 S BIV(I)=$P(BITOTS,U,I)
;**********
;
S X=$$PAD(" Total Number of Patients 19 years and older",56)_": "
S X=X_$$C(BIV(1),0,8) D WRITE(.BILINE,X,1)
;
S X=$$PAD(" TETANUS: # patients w/Td in past 10 years",56)
S X=X_": "_$$C(BIV(2),0,8)
I BIV(1) S X=X_$J((BIV(2)/BIV(1))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" TETANUS: # patients w/Tdap in past 10 years",56)
S X=X_": "_$$C(BIV(3),0,8)
I BIV(1) S X=X_$J((BIV(3)/BIV(1))*100,7,1)
D WRITE(.BILINE,X,1)
;
;---> Females (pcs 4-7).
S X=$$PAD(" HPV: Total # Female patients age 19-26",56)
S X=X_": "_$$C(BIV(4),0,8)
I BIV(1) S X=X_$J((BIV(4)/BIV(1))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Female patients age 19-26 w/HPV1",56)
S X=X_": "_$$C(BIV(5),0,8)
I BIV(4) S X=X_$J((BIV(5)/BIV(4))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Female patients age 19-26 w/HPV2",56)
S X=X_": "_$$C(BIV(6),0,8)
I BIV(4) S X=X_$J((BIV(6)/BIV(4))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Female patients age 19-26 w/HPV3",56)
S X=X_": "_$$C(BIV(7),0,8)
I BIV(4) S X=X_$J((BIV(7)/BIV(4))*100,7,1)
D WRITE(.BILINE,X,1)
;
;---> Males (pcs 8-11).
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Change male age to display "19-21".
S X=$$PAD(" HPV: Total # Male patients age 19-21",56)
S X=X_": "_$$C(BIV(8),0,8)
I BIV(1) S X=X_$J((BIV(8)/BIV(1))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Male patients age 19-21 w/HPV1",56)
S X=X_": "_$$C(BIV(9),0,8)
I BIV(8) S X=X_$J((BIV(9)/BIV(8))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Male patients age 19-21 w/HPV2",56)
S X=X_": "_$$C(BIV(10),0,8)
I BIV(8) S X=X_$J((BIV(10)/BIV(8))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" HPV: # Male patients age 19-21 w/HPV3",56)
;**********
;
S X=X_": "_$$C(BIV(11),0,8)
I BIV(8) S X=X_$J((BIV(11)/BIV(8))*100,7,1)
D WRITE(.BILINE,X,1)
;
;---> Total patients over 60 & Zoster. (pcs 12-13).
S X=$$PAD(" Total Number of Patients 60 years and older",56)
S X=X_": "_$$C(BIV(12),0,8)
I BIV(1) S X=X_$J((BIV(12)/BIV(1))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" ZOSTER: # patients w/Zostavax ever",56)
S X=X_": "_$$C(BIV(13),0,8)
I BIV(12) S X=X_$J((BIV(13)/BIV(12))*100,7,1)
D WRITE(.BILINE,X,1)
;
;
;---> Total patients over 65 (pcs 14-16).
S X=$$PAD(" Total Number of Patients 65 years and older",56)
S X=X_": "_$$C(BIV(14),0,8)
I BIV(1) S X=X_$J((BIV(14)/BIV(1))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" TETANUS: # patients w/Td in past 10 years",56)
S X=X_": "_$$C(BIV(15),0,8)
I BIV(14) S X=X_$J((BIV(15)/BIV(14))*100,7,1)
D WRITE(.BILINE,X)
;
;S X=$$PAD(" INFLUENZA: # pts w/Influenza vaccine in past year",56)
;S X=X_": "_$$C(BIV(9),0,8)
;I BIV(7) S X=X_$J((BIV(9)/BIV(7))*100,7,1)
;D WRITE(.BILINE,X,1)
;
S X=$$PAD(" PNEUMOVAX: # patients w/Pneumovax at or over 65 yrs",56)
S X=X_": "_$$C(BIV(16),0,8)
I BIV(14) S X=X_$J((BIV(16)/BIV(14))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" PNEUMOVAX: # patients w/Pneumovax ever",56)
S X=X_": "_$$C(BIV(17),0,8)
I BIV(14) S X=X_$J((BIV(17)/BIV(14))*100,7,1)
D WRITE(.BILINE,X,1)
;
;---> 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 included who had Refusals on record....:"_$J(N,8)
D WRITE(.BILINE,X,2)
;
;
;
;********** PATCH 12, v8.5, MAY 01,2016, IHS/CMI/MWR
;---> New Composite Measures display.
;
S X=$$PAD(" * * * NEW GPRA COMPOSITE MEASURE SECTION * * *")
D WRITE(.BILINE,X,1)
;
S X=$$PAD(" Total Number of Patients ages 19 through 59 years",56)_": "
S X=X_$$C(BIV(18),0,8) D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap ever",56)
S X=X_": "_$$C(BIV(19),0,8)
I BIV(18) S X=X_$J((BIV(19)/BIV(18))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
S X=X_": "_$$C(BIV(20),0,8)
I BIV(18) S X=X_$J((BIV(20)/BIV(18))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose Tdap ever AND Tdap or Td <10 years",56)
S X=X_": "_$$C(BIV(21),0,8)
I BIV(1) S X=X_$J((BIV(21)/BIV(18))*100,7,1)
D WRITE(.BILINE,X,1)
;
;
S X=$$PAD(" Total Number of Patients ages 60 through 64 years",56)_": "
S X=X_$$C(BIV(22),0,8) D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap ever",56)
S X=X_": "_$$C(BIV(23),0,8)
I BIV(22) S X=X_$J((BIV(23)/BIV(22))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
S X=X_": "_$$C(BIV(24),0,8)
I BIV(22) S X=X_$J((BIV(24)/BIV(22))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Zoster ever",56)
S X=X_": "_$$C(BIV(25),0,8)
I BIV(22) S X=X_$J((BIV(25)/BIV(22))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received Tdap ever AND Tdap/Td <10 yrs AND Zoster",56)
S X=X_": "_$$C(BIV(26),0,8)
I BIV(22) S X=X_$J((BIV(26)/BIV(22))*100,7,1)
D WRITE(.BILINE,X,1)
;
;
S X=$$PAD(" Total Number of Patients 65 years and older",56)_": "
S X=X_$$C(BIV(27),0,8) D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap ever",56)
S X=X_": "_$$C(BIV(28),0,8)
I BIV(27) S X=X_$J((BIV(28)/BIV(27))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
S X=X_": "_$$C(BIV(29),0,8)
I BIV(27) S X=X_$J((BIV(29)/BIV(27))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Zoster ever",56)
S X=X_": "_$$C(BIV(30),0,8)
I BIV(27) S X=X_$J((BIV(30)/BIV(27))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received 1 dose of Pneumo after 65 yrs OR last 5yrs",56)
S X=X_": "_$$C(BIV(31),0,8)
I BIV(27) S X=X_$J((BIV(31)/BIV(27))*100,7,1)
D WRITE(.BILINE,X)
;
S X=$$PAD(" Received Tdap AND Tdap/Td <10y AND Zoster AND Pneumo",56)
S X=X_": "_$$C(BIV(32),0,8)
I BIV(27) S X=X_$J((BIV(32)/BIV(27))*100,7,1)
D WRITE(.BILINE,X,1)
;
;
S X=$$PAD(" Total Number of Patients 19 years and older",56)_": "
S X=X_$$C(BIV(33),0,8) D WRITE(.BILINE,X)
;
S X=$$PAD(" Total Patients 19 years and older appropriately ",52)
D WRITE(.BILINE,X)
S X=$$PAD(" vaccinated per age recommendations",56)
S X=X_": "_$$C(BIV(34),0,8)
I BIV(33) S X=X_$J((BIV(34)/BIV(33))*100,7,1)
D WRITE(.BILINE,X,1)
;**********
;
S VALMCNT=BILINE
Q
;
;
;----------
WRITE(BILINE,BIVAL,BIBLNK) ;EP
;---> Write lines to ^TMP (see documentation in ^BIW).
;---> Parameters:
; 1 - BILINE (ret) Last line# written.
; 2 - BIVAL (opt) Value/text of line (Null=blank line).
; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
;
Q:'$D(BILINE)
D WL^BIW(.BILINE,"BIREPL1",$G(BIVAL),$G(BIBLNK))
;
;--->Set VALMCNT (Listman line count) for errors calls above.
S VALMCNT=BILINE
Q
;
;
C(X,X2,X3) ;
D COMMA^%DTC
Q X
;
;
;----------
PAD(D,L,C) ;EP
Q $$PAD^BIUTL5($G(D),$G(L),".")
BIREPL2 ;IHS/CMI/MWR - REPORT, ADULT IMM; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;**12**;MAY 01,2016
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW ADULT IMMUNIZATION REPORT, GATHER DATA.
+4 ;; PATCH 3: Remove Date Range line (no longer relevant). HEAD+33
+5 ;; PATCH 3: Set HPV upper limit display for males to 21 years. DISPLAY+69
+6 ;; PATCH 12: Add new Composite Measures. DISPLAY+25
+7 ;
+8 ;
+9 ;----------
HEAD(BIQDT,BICC,BIHCF,BIBEN,BICPTI,BIUP) ;EP
+1 ;---> Produce Header array for ADULT Immunization Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BICC (req) Current Community array.
+5 ; 3 - BIHCF (req) Health Care Facility array.
+6 ; 4 - BIBEN (req) Beneficiary Type array.
+7 ; 5 - BICPTI (req) 1=Include CPT Coded Visits, 0=Ignore CPT
+8 ; 6 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
+9 ;
+10 ;---> Check for required Variables.
+11 IF '$GET(BIQDT)
QUIT
+12 IF '$DATA(BICC)
QUIT
+13 IF '$DATA(BIHCF)
QUIT
+14 IF '$DATA(BIBEN)
QUIT
+15 IF '$DATA(BICPTI)
SET BICPTI=0
+16 IF '$DATA(BIUP)
QUIT
+17 ;
+18 KILL VALMHDR
+19 NEW BILINE,X
SET BILINE=0
+20 ;
+21 NEW X
SET X=""
+22 ;---> If Header array is NOT being for Listmananger include version.
+23 IF '$DATA(VALM("BM"))
SET X=$$LMVER^BILOGO()
+24 ;
+25 DO WH^BIW(.BILINE,X)
+26 SET X=$$REPHDR^BIUTL6(DUZ(2))
DO CENTERT^BIUTL5(.X)
+27 DO WH^BIW(.BILINE,X)
+28 ;
+29 SET X="* Adult Immunization Report *"
DO CENTERT^BIUTL5(.X)
+30 DO WH^BIW(.BILINE,X)
+31 ;
+32 SET X=$$SP^BIUTL5(27)_"Report Date: "_$$SLDT1^BIUTL5(DT)
+33 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+34 ;---> Remove Date Range line (no longer relevant).
+35 ;D WH^BIW(.BILINE,X)
+36 DO WH^BIW(.BILINE,X,1)
+37 ;
+38 ;S X=$$SP^BIUTL5(28)_"Date Range: "_$$SLDT1^BIUTL5(BIQDT-10000)_" - "_$$SLDT1^BIUTL5(BIQDT)
+39 ;D WH^BIW(.BILINE,X,1)
+40 ;**********
+41 ;
+42 SET X=" "_$$BIUPTX^BIUTL6(BIUP)
+43 IF BICPTI
SET X=$$PAD^BIUTL5(X,52)_"* CPT Coded Visits Included"
+44 DO WH^BIW(.BILINE,X)
+45 DO WH^BIW(.BILINE,$$SP^BIUTL5(79,"-"))
+46 ;
+47 Begin DoDot:1
+48 ;---> If specific Communities were selected (not ALL), then print
+49 ;---> the Communities in a subheader at the top of the report.
+50 DO SUBH^BIOUTPT5("BICC","Community",,"^AUTTCOM(",.BILINE,.BIERR,,13)
+51 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+52 ;
+53 ;---> If specific Health Care Facilities, print subheader.
+54 DO SUBH^BIOUTPT5("BIHCF","Facility",,"^DIC(4,",.BILINE,.BIERR,,13)
+55 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+56 ;
+57 ;---> If specific Beneficiary Types, print Beneficiary Type subheader.
+58 DO SUBH^BIOUTPT5("BIBEN","Beneficiary Type",,"^AUTTBEN(",.BILINE,.BIERR,,13)
+59 IF $GET(BIERR)
DO ERRCD^BIUTL2(BIERR,.X)
DO WH^BIW(.BILINE,X)
QUIT
+60 ;
+61 SET X=$$SP^BIUTL5(59)_"Number Percent"
+62 DO WH^BIW(.BILINE,X)
End DoDot:1
+63 ;
+64 ;---> If Header array is being built for Listmananger,
+65 ;---> reset display window margins for Communities, etc.
+66 IF $DATA(VALM("BM"))
Begin DoDot:1
+67 SET VALM("TM")=BILINE+3
+68 SET VALM("LINES")=VALM("BM")-VALM("TM")+1
+69 ;---> Safeguard to prevent divide/0 error.
+70 IF VALM("LINES")<1
SET VALM("LINES")=1
End DoDot:1
+71 QUIT
+72 ;
+73 ;
+74 ;----------
START(BIQDT,BICC,BIHCF,BIBEN,BICPTI,BIUP) ;EP
+1 ;---> Produce array for ADULT Immunization Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BICC (req) Current Community array.
+5 ; 3 - BIHCF (req) Health Care Facility array.
+6 ; 4 - BIBEN (req) Beneficiary Type array.
+7 ; 5 - BICPTI (req) 1=Include CPT Coded Visits, 0=Ignore CPT (default).
+8 ; 6 - BIUP (req) User Population/Group (Registered, Imm, User, Active).
+9 ;
+10 NEW BILINE,BITMP,X
SET BILINE=0
+11 KILL ^TMP("BIREPL1",$JOB)
+12 ;
+13 ;---> Check for required Variables.
+14 ;---> Fix for v8.1 by adding .X to error calls below.
+15 IF '$GET(BIQDT)
DO ERRCD^BIUTL2(623,.X)
DO WRITE(.BILINE,X)
QUIT
+16 IF '$DATA(BICC)
DO ERRCD^BIUTL2(614,.X)
DO WRITE(.BILINE,X)
QUIT
+17 IF '$DATA(BIHCF)
DO ERRCD^BIUTL2(625,.X)
DO WRITE(.BILINE,X)
QUIT
+18 IF '$DATA(BIBEN)
DO ERRCD^BIUTL2(662,.X)
DO WRITE(.BILINE,X)
QUIT
+19 IF '$DATA(BICPTI)
SET BICPTI=0
+20 IF $GET(BIUP)=""
SET BIUP="u"
+21 ;
+22 DO GETSTATS^BIREPL3(BIQDT,.BICC,.BIHCF,.BIBEN,BICPTI,BIUP,.BITOTS)
+23 DO DISPLAY(BITOTS,.BILINE)
+24 SET VALMCNT=BILINE
+25 QUIT
+26 ;
+27 ;
+28 ;----------
DISPLAY(BITOTS,BILINE) ;EP
+1 ;---> Write Adult Stats for display.
+2 ;---> Parameters:
+3 ; 1 - BITOTS (req) Totals delimited by "^":
+4 ; Pc Variable
+5 ; 1 - BI19=Total over 19
+6 ; 2 - BIT19 = Number over 19 w/Tetanus past 10 years.
+7 ; 3 - BITDAP = Number over 19 w/Tdap past 10 years.
+8 ;
+9 ; 4 - BIHPVF = Total number of Females age 19-26
+10 ; 5 - BIHPVF1 = Number Females 19-26 w/HPV-1
+11 ; 6 - BIHPVF2 = Number Females 19-26 w/HPV-2
+12 ; 7 - BIHPVF3 = Number Females 19-26 w/HPV-3
+13 ; 8 - BIHPVF = Total number of Males age 19-26
+14 ; 9 - BIHPVM1 = Number Males 19-26 w/HPV-1
+15 ; 10 - BIHPVM2 = Number Males 19-26 w/HPV-2
+16 ; 11 - BIHPVM3 = Number Males 19-26 w/HPV-3
+17 ;
+18 ; 12 - BI60=Total over 60
+19 ; 13 - BIZ60 = Number over 60 w/Zoster ever.
+20 ; 14 - BI65=Total over 65
+21 ; 15 - BIT65 = Number over 65 w/Tetanus past 10 years.
+22 ; 16 - BIP65 = Number over 65 w/Pneumo at or after 65 years.
+23 ; 17 - BIP65E = Number over 65 w/Pneumo EVER.
+24 ;
+25 ;********** PATCH 12, v8.5, MAY 01,2016, IHS/CMI/MWR
+26 ;---> New Composite Measure Variables.
+27 ; 18 - BIC19=Total >19 <60
+28 ; 19 - BIC191=Tdap ever
+29 ; 20 - BIC192=(Td or Tdap) <10 yrs
+30 ; 21 - BIC193=(Tdap ever) AND ((Tdap or Td) <10 yrs)
+31 ;
+32 ; 22 - BIC60=Total >60 <65
+33 ; 23 - BIC601=Tdap ever
+34 ; 24 - BIC602=(Td or Tdap) <10 yrs
+35 ; 25 - BIC603=Zoster
+36 ; 26 - BIC604=(Tdap ever) AND ((Tdap or Td) <10 yrs) AND Zoster
+37 ;
+38 ; 27 - BIC65=Total >65
+39 ; 28 - BIC651=Tdap ever
+40 ; 29 - BIC652=(Td or Tdap) <10 yrs
+41 ; 30 - BIC653=Zoster
+42 ; 31 - BIC654=Pneumo >65 yrs
+43 ; 32 - BIC655=(Tdap ever) AND ((Tdap or Td) <10 yrs) AND Zoster AND Pneumo
+44 ; 33 - BICUTDD=Overall UTD Denominator
+45 ; 34 - BICUTDN-Overall UTD Numerator
+46 ;
+47 ;
+48 ; 1 - BILINE (ret) Number of lines written to Listman scroll area.
+49 ;
+50 IF $GET(BITOTS)=""
DO ERRCD^BIUTL2(667,.X)
DO WRITE(.BILINE,X)
QUIT
+51 ;
+52 ;---> Set totals into BIV local array, 1-15.
+53 ;**********
+54 ;N BIV,I F I=1:1:17 S BIV(I)=$P(BITOTS,U,I)
+55 NEW BIV,I
FOR I=1:1:34
SET BIV(I)=$PIECE(BITOTS,U,I)
+56 ;**********
+57 ;
+58 SET X=$$PAD(" Total Number of Patients 19 years and older",56)_": "
+59 SET X=X_$$C(BIV(1),0,8)
DO WRITE(.BILINE,X,1)
+60 ;
+61 SET X=$$PAD(" TETANUS: # patients w/Td in past 10 years",56)
+62 SET X=X_": "_$$C(BIV(2),0,8)
+63 IF BIV(1)
SET X=X_$JUSTIFY((BIV(2)/BIV(1))*100,7,1)
+64 DO WRITE(.BILINE,X)
+65 ;
+66 SET X=$$PAD(" TETANUS: # patients w/Tdap in past 10 years",56)
+67 SET X=X_": "_$$C(BIV(3),0,8)
+68 IF BIV(1)
SET X=X_$JUSTIFY((BIV(3)/BIV(1))*100,7,1)
+69 DO WRITE(.BILINE,X,1)
+70 ;
+71 ;---> Females (pcs 4-7).
+72 SET X=$$PAD(" HPV: Total # Female patients age 19-26",56)
+73 SET X=X_": "_$$C(BIV(4),0,8)
+74 IF BIV(1)
SET X=X_$JUSTIFY((BIV(4)/BIV(1))*100,7,1)
+75 DO WRITE(.BILINE,X)
+76 ;
+77 SET X=$$PAD(" HPV: # Female patients age 19-26 w/HPV1",56)
+78 SET X=X_": "_$$C(BIV(5),0,8)
+79 IF BIV(4)
SET X=X_$JUSTIFY((BIV(5)/BIV(4))*100,7,1)
+80 DO WRITE(.BILINE,X)
+81 ;
+82 SET X=$$PAD(" HPV: # Female patients age 19-26 w/HPV2",56)
+83 SET X=X_": "_$$C(BIV(6),0,8)
+84 IF BIV(4)
SET X=X_$JUSTIFY((BIV(6)/BIV(4))*100,7,1)
+85 DO WRITE(.BILINE,X)
+86 ;
+87 SET X=$$PAD(" HPV: # Female patients age 19-26 w/HPV3",56)
+88 SET X=X_": "_$$C(BIV(7),0,8)
+89 IF BIV(4)
SET X=X_$JUSTIFY((BIV(7)/BIV(4))*100,7,1)
+90 DO WRITE(.BILINE,X,1)
+91 ;
+92 ;---> Males (pcs 8-11).
+93 ;
+94 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+95 ;---> Change male age to display "19-21".
+96 SET X=$$PAD(" HPV: Total # Male patients age 19-21",56)
+97 SET X=X_": "_$$C(BIV(8),0,8)
+98 IF BIV(1)
SET X=X_$JUSTIFY((BIV(8)/BIV(1))*100,7,1)
+99 DO WRITE(.BILINE,X)
+100 ;
+101 SET X=$$PAD(" HPV: # Male patients age 19-21 w/HPV1",56)
+102 SET X=X_": "_$$C(BIV(9),0,8)
+103 IF BIV(8)
SET X=X_$JUSTIFY((BIV(9)/BIV(8))*100,7,1)
+104 DO WRITE(.BILINE,X)
+105 ;
+106 SET X=$$PAD(" HPV: # Male patients age 19-21 w/HPV2",56)
+107 SET X=X_": "_$$C(BIV(10),0,8)
+108 IF BIV(8)
SET X=X_$JUSTIFY((BIV(10)/BIV(8))*100,7,1)
+109 DO WRITE(.BILINE,X)
+110 ;
+111 SET X=$$PAD(" HPV: # Male patients age 19-21 w/HPV3",56)
+112 ;**********
+113 ;
+114 SET X=X_": "_$$C(BIV(11),0,8)
+115 IF BIV(8)
SET X=X_$JUSTIFY((BIV(11)/BIV(8))*100,7,1)
+116 DO WRITE(.BILINE,X,1)
+117 ;
+118 ;---> Total patients over 60 & Zoster. (pcs 12-13).
+119 SET X=$$PAD(" Total Number of Patients 60 years and older",56)
+120 SET X=X_": "_$$C(BIV(12),0,8)
+121 IF BIV(1)
SET X=X_$JUSTIFY((BIV(12)/BIV(1))*100,7,1)
+122 DO WRITE(.BILINE,X)
+123 ;
+124 SET X=$$PAD(" ZOSTER: # patients w/Zostavax ever",56)
+125 SET X=X_": "_$$C(BIV(13),0,8)
+126 IF BIV(12)
SET X=X_$JUSTIFY((BIV(13)/BIV(12))*100,7,1)
+127 DO WRITE(.BILINE,X,1)
+128 ;
+129 ;
+130 ;---> Total patients over 65 (pcs 14-16).
+131 SET X=$$PAD(" Total Number of Patients 65 years and older",56)
+132 SET X=X_": "_$$C(BIV(14),0,8)
+133 IF BIV(1)
SET X=X_$JUSTIFY((BIV(14)/BIV(1))*100,7,1)
+134 DO WRITE(.BILINE,X)
+135 ;
+136 SET X=$$PAD(" TETANUS: # patients w/Td in past 10 years",56)
+137 SET X=X_": "_$$C(BIV(15),0,8)
+138 IF BIV(14)
SET X=X_$JUSTIFY((BIV(15)/BIV(14))*100,7,1)
+139 DO WRITE(.BILINE,X)
+140 ;
+141 ;S X=$$PAD(" INFLUENZA: # pts w/Influenza vaccine in past year",56)
+142 ;S X=X_": "_$$C(BIV(9),0,8)
+143 ;I BIV(7) S X=X_$J((BIV(9)/BIV(7))*100,7,1)
+144 ;D WRITE(.BILINE,X,1)
+145 ;
+146 SET X=$$PAD(" PNEUMOVAX: # patients w/Pneumovax at or over 65 yrs",56)
+147 SET X=X_": "_$$C(BIV(16),0,8)
+148 IF BIV(14)
SET X=X_$JUSTIFY((BIV(16)/BIV(14))*100,7,1)
+149 DO WRITE(.BILINE,X)
+150 ;
+151 SET X=$$PAD(" PNEUMOVAX: # patients w/Pneumovax ever",56)
+152 SET X=X_": "_$$C(BIV(17),0,8)
+153 IF BIV(14)
SET X=X_$JUSTIFY((BIV(17)/BIV(14))*100,7,1)
+154 DO WRITE(.BILINE,X,1)
+155 ;
+156 ;---> Now write total patients considered who had refusals.
+157 NEW M,N
SET (M,N)=0
FOR
SET M=$ORDER(BITMP("REFUSALS",M))
IF 'M
QUIT
SET N=N+1
+158 SET X=" Total Patients included who had Refusals on record....:"_$JUSTIFY(N,8)
+159 DO WRITE(.BILINE,X,2)
+160 ;
+161 ;
+162 ;
+163 ;********** PATCH 12, v8.5, MAY 01,2016, IHS/CMI/MWR
+164 ;---> New Composite Measures display.
+165 ;
+166 SET X=$$PAD(" * * * NEW GPRA COMPOSITE MEASURE SECTION * * *")
+167 DO WRITE(.BILINE,X,1)
+168 ;
+169 SET X=$$PAD(" Total Number of Patients ages 19 through 59 years",56)_": "
+170 SET X=X_$$C(BIV(18),0,8)
DO WRITE(.BILINE,X)
+171 ;
+172 SET X=$$PAD(" Received 1 dose of Tdap ever",56)
+173 SET X=X_": "_$$C(BIV(19),0,8)
+174 IF BIV(18)
SET X=X_$JUSTIFY((BIV(19)/BIV(18))*100,7,1)
+175 DO WRITE(.BILINE,X)
+176 ;
+177 SET X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
+178 SET X=X_": "_$$C(BIV(20),0,8)
+179 IF BIV(18)
SET X=X_$JUSTIFY((BIV(20)/BIV(18))*100,7,1)
+180 DO WRITE(.BILINE,X)
+181 ;
+182 SET X=$$PAD(" Received 1 dose Tdap ever AND Tdap or Td <10 years",56)
+183 SET X=X_": "_$$C(BIV(21),0,8)
+184 IF BIV(1)
SET X=X_$JUSTIFY((BIV(21)/BIV(18))*100,7,1)
+185 DO WRITE(.BILINE,X,1)
+186 ;
+187 ;
+188 SET X=$$PAD(" Total Number of Patients ages 60 through 64 years",56)_": "
+189 SET X=X_$$C(BIV(22),0,8)
DO WRITE(.BILINE,X)
+190 ;
+191 SET X=$$PAD(" Received 1 dose of Tdap ever",56)
+192 SET X=X_": "_$$C(BIV(23),0,8)
+193 IF BIV(22)
SET X=X_$JUSTIFY((BIV(23)/BIV(22))*100,7,1)
+194 DO WRITE(.BILINE,X)
+195 ;
+196 SET X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
+197 SET X=X_": "_$$C(BIV(24),0,8)
+198 IF BIV(22)
SET X=X_$JUSTIFY((BIV(24)/BIV(22))*100,7,1)
+199 DO WRITE(.BILINE,X)
+200 ;
+201 SET X=$$PAD(" Received 1 dose of Zoster ever",56)
+202 SET X=X_": "_$$C(BIV(25),0,8)
+203 IF BIV(22)
SET X=X_$JUSTIFY((BIV(25)/BIV(22))*100,7,1)
+204 DO WRITE(.BILINE,X)
+205 ;
+206 SET X=$$PAD(" Received Tdap ever AND Tdap/Td <10 yrs AND Zoster",56)
+207 SET X=X_": "_$$C(BIV(26),0,8)
+208 IF BIV(22)
SET X=X_$JUSTIFY((BIV(26)/BIV(22))*100,7,1)
+209 DO WRITE(.BILINE,X,1)
+210 ;
+211 ;
+212 SET X=$$PAD(" Total Number of Patients 65 years and older",56)_": "
+213 SET X=X_$$C(BIV(27),0,8)
DO WRITE(.BILINE,X)
+214 ;
+215 SET X=$$PAD(" Received 1 dose of Tdap ever",56)
+216 SET X=X_": "_$$C(BIV(28),0,8)
+217 IF BIV(27)
SET X=X_$JUSTIFY((BIV(28)/BIV(27))*100,7,1)
+218 DO WRITE(.BILINE,X)
+219 ;
+220 SET X=$$PAD(" Received 1 dose of Tdap or Td <10 years",56)
+221 SET X=X_": "_$$C(BIV(29),0,8)
+222 IF BIV(27)
SET X=X_$JUSTIFY((BIV(29)/BIV(27))*100,7,1)
+223 DO WRITE(.BILINE,X)
+224 ;
+225 SET X=$$PAD(" Received 1 dose of Zoster ever",56)
+226 SET X=X_": "_$$C(BIV(30),0,8)
+227 IF BIV(27)
SET X=X_$JUSTIFY((BIV(30)/BIV(27))*100,7,1)
+228 DO WRITE(.BILINE,X)
+229 ;
+230 SET X=$$PAD(" Received 1 dose of Pneumo after 65 yrs OR last 5yrs",56)
+231 SET X=X_": "_$$C(BIV(31),0,8)
+232 IF BIV(27)
SET X=X_$JUSTIFY((BIV(31)/BIV(27))*100,7,1)
+233 DO WRITE(.BILINE,X)
+234 ;
+235 SET X=$$PAD(" Received Tdap AND Tdap/Td <10y AND Zoster AND Pneumo",56)
+236 SET X=X_": "_$$C(BIV(32),0,8)
+237 IF BIV(27)
SET X=X_$JUSTIFY((BIV(32)/BIV(27))*100,7,1)
+238 DO WRITE(.BILINE,X,1)
+239 ;
+240 ;
+241 SET X=$$PAD(" Total Number of Patients 19 years and older",56)_": "
+242 SET X=X_$$C(BIV(33),0,8)
DO WRITE(.BILINE,X)
+243 ;
+244 SET X=$$PAD(" Total Patients 19 years and older appropriately ",52)
+245 DO WRITE(.BILINE,X)
+246 SET X=$$PAD(" vaccinated per age recommendations",56)
+247 SET X=X_": "_$$C(BIV(34),0,8)
+248 IF BIV(33)
SET X=X_$JUSTIFY((BIV(34)/BIV(33))*100,7,1)
+249 DO WRITE(.BILINE,X,1)
+250 ;**********
+251 ;
+252 SET VALMCNT=BILINE
+253 QUIT
+254 ;
+255 ;
+256 ;----------
WRITE(BILINE,BIVAL,BIBLNK) ;EP
+1 ;---> Write lines to ^TMP (see documentation in ^BIW).
+2 ;---> Parameters:
+3 ; 1 - BILINE (ret) Last line# written.
+4 ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
+5 ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
+6 ;
+7 IF '$DATA(BILINE)
QUIT
+8 DO WL^BIW(.BILINE,"BIREPL1",$GET(BIVAL),$GET(BIBLNK))
+9 ;
+10 ;--->Set VALMCNT (Listman line count) for errors calls above.
+11 SET VALMCNT=BILINE
+12 QUIT
+13 ;
+14 ;
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X
+3 ;
+4 ;
+5 ;----------
PAD(D,L,C) ;EP
+1 QUIT $$PAD^BIUTL5($GET(D),$GET(L),".")