BIREPT2 ;IHS/CMI/MWR - REPORT, TWO-YR-OLD RATES; MAY 10, 2010
;;8.5;IMMUNIZATION;**3**;SEP 10,2012
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW TWO-YR-OLD IMMUNIZATION RATES REPORT, GATHER DATA.
;; PATCH 3: Add report line for Hx of Chickenpox. START+34
;
;
;----------
HEAD(BIQDT,BITAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BIUP) ;EP
;---> Produce Header array for Two-Yr-Old Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BITAR (req) Two-Yr-Old Report Age Range, default="19-35".
; 3 - BIAGRPS (req) String of Age Groups (e.g., 3,5,7,16,19,24,36)
; 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(BITAR)
Q:'$G(BIAGRPS)
S:$G(BIUP)="" BIUP="u"
;
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="* Two-Yr-Old Immunization Report ("_$P(BITAR,"-")_"-35 mths) *"
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,54)
;
S X=X_$J("Total Patients: "_$G(BITOTPTS),24)
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,,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
.;
.S X=" Received by | 3 mo 5 mo 7 mo 16 mo 19 mo"
.S:BIAGRPS["24" X=X_" 24 mo"
.S X=X_" "_$$SLDT2^BIUTL5(BIQDT,1)
.D WH^BIW(.BILINE,X)
.S X=" | # % # % # % # % # %"
.S X=X_" # %"
.S:BIAGRPS["24" X=X_" # %"
.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,BITAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BISITE,BIUP) ;EP
;---> Produce array for Quarterly Immunization Report.
;---> Parameters:
; 1 - BIQDT (req) Quarter Ending Date.
; 2 - BITAR (opt) Two-Yr-Old Report Age Range, default="19-35".
; 3 - BIAGRPS (req) String of Age Groups (e.g., 3,5,7,16,19,24,36)
; 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 (Registered, Imm, User, Active).
;
K ^TMP("BIREPT1",$J)
N BILINE,BITMP,X S BILINE=0
;
;---> Check for required Variables.
I '$G(BIQDT) D ERRCD^BIUTL2(623,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$D(BITAR) D ERRCD^BIUTL2(613,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$G(BIAGRPS) D ERRCD^BIUTL2(677,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$D(BICC) D ERRCD^BIUTL2(614,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$D(BIHCF) D ERRCD^BIUTL2(625,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$D(BICM) D ERRCD^BIUTL2(615,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$D(BIBEN) D ERRCD^BIUTL2(662,.X) D WRITE^BIREPT3(.BILINE,X) Q
I '$G(BISITE) S BISITE=$G(DUZ(2))
I '$G(BISITE) D ERRCD^BIUTL2(109,.X) D WRITE^BIREPT3(.BILINE,X) Q
S:$G(BIUP)="" BIUP="u"
;
;---> Gather data.
D GETDATA^BIREPT3(.BICC,.BIHCF,.BICM,.BIBEN,BIQDT,BITAR,BIAGRPS,BISITE,BIUP,.BIERR)
I $G(BIERR)]"" D WRITE^BIREPT3(.BILINE,BIERR) Q
;
;---> Write Statistics lines for each Vaccine Group (BIVGRP).
;
;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
;---> Add report line for Hx of Chickenpox.
;F BIVGRP=1,2,3,4,6,7,9,10,11,15 D VGRP^BIREPT3(.BILINE,BIVGRP,BIAGRPS,.BIERR)
F BIVGRP=1,2,3,4,6,7,132,9,10,11,15 D VGRP^BIREPT3(.BILINE,BIVGRP,BIAGRPS,.BIERR)
;**********
;
I $G(BIERR)]"" D WRITE^BIREPT3(.BILINE,BIERR) Q
;
;---> Write Statistics lines for each Vaccine Combinations.
;---> NOTE: These Combo strings are also used to set BITMP("STATS"
;---> nodes beginning at +130^BIREPT4. vvv83
D VCOMB^BIREPT3(.BILINE,"1|1^2|1^3|1^4|1",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|3",BIAGRPS,.BIERR)
;---> Next combo is up to date (UTD); send 5th parameter=1.
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4",BIAGRPS,.BIERR,1)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|1",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|2^15|3",BIAGRPS,.BIERR)
D VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|2^15|3^10|2",BIAGRPS,.BIERR)
I $G(BIERR)]"" D WRITE^BIREPT3(.BILINE,BIERR) Q
;
;---> BITOTPTS (total patients) not newed here because it is also
;---> used in the Header.
S BITOTPTS=+$G(BITMP("STATS","TOTLPTS"))
S X=" Total Active Patients reviewed"_$J(BITOTPTS,44)
D WRITE^BIREPT3(.BILINE,X)
D WRITE^BIREPT3(.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 included who had Refusals on record"_$J(N,24)
D WRITE^BIREPT3(.BILINE,X),WRITE^BIREPT3(.BILINE,$$SP^BIUTL5(79,"-"))
;
;---> Set final VALMCNT (Listman line count).
S VALMCNT=BILINE
Q
BIREPT2 ;IHS/CMI/MWR - REPORT, TWO-YR-OLD RATES; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;**3**;SEP 10,2012
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW TWO-YR-OLD IMMUNIZATION RATES REPORT, GATHER DATA.
+4 ;; PATCH 3: Add report line for Hx of Chickenpox. START+34
+5 ;
+6 ;
+7 ;----------
HEAD(BIQDT,BITAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BIUP) ;EP
+1 ;---> Produce Header array for Two-Yr-Old Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BITAR (req) Two-Yr-Old Report Age Range, default="19-35".
+5 ; 3 - BIAGRPS (req) String of Age Groups (e.g., 3,5,7,16,19,24,36)
+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(BITAR)
QUIT
+19 IF '$GET(BIAGRPS)
QUIT
+20 IF $GET(BIUP)=""
SET BIUP="u"
+21 ;
+22 KILL VALMHDR
+23 NEW BILINE,X
SET BILINE=0
+24 ;
+25 NEW X
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="* Two-Yr-Old Immunization Report ("_$PIECE(BITAR,"-")_"-35 mths) *"
+34 DO CENTERT^BIUTL5(.X)
+35 DO WH^BIW(.BILINE,X)
+36 ;
+37 SET X=$$SP^BIUTL5(27)_"Report Date: "_$$SLDT1^BIUTL5(DT)
+38 DO WH^BIW(.BILINE,X)
+39 ;
+40 SET X=$$SP^BIUTL5(30)_"End Date: "_$$SLDT1^BIUTL5(BIQDT)
+41 DO WH^BIW(.BILINE,X,1)
+42 ;
+43 SET X=" "_$$BIUPTX^BIUTL6(BIUP)
+44 IF BIUP="i"
SET X=" "_$$BIUPTX^BIUTL6(BIUP,1)_" (Active)"
+45 SET X=$$PAD^BIUTL5(X,54)
+46 ;
+47 SET X=X_$JUSTIFY("Total Patients: "_$GET(BITOTPTS),24)
+48 DO WH^BIW(.BILINE,X)
+49 ;
+50 DO WH^BIW(.BILINE,$$SP^BIUTL5(79,"-"))
+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 SET X=" Received by | 3 mo 5 mo 7 mo 16 mo 19 mo"
+71 IF BIAGRPS["24"
SET X=X_" 24 mo"
+72 SET X=X_" "_$$SLDT2^BIUTL5(BIQDT,1)
+73 DO WH^BIW(.BILINE,X)
+74 SET X=" | # % # % # % # % # %"
+75 SET X=X_" # %"
+76 IF BIAGRPS["24"
SET X=X_" # %"
+77 DO WH^BIW(.BILINE,X)
End DoDot:1
+78 ;
+79 ;---> If Header array is being built for Listmananger,
+80 ;---> reset display window margins for Communities, etc.
+81 IF $DATA(VALM("BM"))
Begin DoDot:1
+82 SET VALM("TM")=BILINE+3
+83 SET VALM("LINES")=VALM("BM")-VALM("TM")+1
+84 ;---> Safeguard to prevent divide/0 error.
+85 IF VALM("LINES")<1
SET VALM("LINES")=1
End DoDot:1
+86 QUIT
+87 ;
+88 ;
+89 ;----------
START(BIQDT,BITAR,BIAGRPS,BICC,BIHCF,BICM,BIBEN,BISITE,BIUP) ;EP
+1 ;---> Produce array for Quarterly Immunization Report.
+2 ;---> Parameters:
+3 ; 1 - BIQDT (req) Quarter Ending Date.
+4 ; 2 - BITAR (opt) Two-Yr-Old Report Age Range, default="19-35".
+5 ; 3 - BIAGRPS (req) String of Age Groups (e.g., 3,5,7,16,19,24,36)
+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 (Registered, Imm, User, Active).
+12 ;
+13 KILL ^TMP("BIREPT1",$JOB)
+14 NEW BILINE,BITMP,X
SET BILINE=0
+15 ;
+16 ;---> Check for required Variables.
+17 IF '$GET(BIQDT)
DO ERRCD^BIUTL2(623,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+18 IF '$DATA(BITAR)
DO ERRCD^BIUTL2(613,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+19 IF '$GET(BIAGRPS)
DO ERRCD^BIUTL2(677,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+20 IF '$DATA(BICC)
DO ERRCD^BIUTL2(614,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+21 IF '$DATA(BIHCF)
DO ERRCD^BIUTL2(625,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+22 IF '$DATA(BICM)
DO ERRCD^BIUTL2(615,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+23 IF '$DATA(BIBEN)
DO ERRCD^BIUTL2(662,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+24 IF '$GET(BISITE)
SET BISITE=$GET(DUZ(2))
+25 IF '$GET(BISITE)
DO ERRCD^BIUTL2(109,.X)
DO WRITE^BIREPT3(.BILINE,X)
QUIT
+26 IF $GET(BIUP)=""
SET BIUP="u"
+27 ;
+28 ;---> Gather data.
+29 DO GETDATA^BIREPT3(.BICC,.BIHCF,.BICM,.BIBEN,BIQDT,BITAR,BIAGRPS,BISITE,BIUP,.BIERR)
+30 IF $GET(BIERR)]""
DO WRITE^BIREPT3(.BILINE,BIERR)
QUIT
+31 ;
+32 ;---> Write Statistics lines for each Vaccine Group (BIVGRP).
+33 ;
+34 ;********** PATCH 3, v8.5, SEP 10,2012, IHS/CMI/MWR
+35 ;---> Add report line for Hx of Chickenpox.
+36 ;F BIVGRP=1,2,3,4,6,7,9,10,11,15 D VGRP^BIREPT3(.BILINE,BIVGRP,BIAGRPS,.BIERR)
+37 FOR BIVGRP=1,2,3,4,6,7,132,9,10,11,15
DO VGRP^BIREPT3(.BILINE,BIVGRP,BIAGRPS,.BIERR)
+38 ;**********
+39 ;
+40 IF $GET(BIERR)]""
DO WRITE^BIREPT3(.BILINE,BIERR)
QUIT
+41 ;
+42 ;---> Write Statistics lines for each Vaccine Combinations.
+43 ;---> NOTE: These Combo strings are also used to set BITMP("STATS"
+44 ;---> nodes beginning at +130^BIREPT4. vvv83
+45 DO VCOMB^BIREPT3(.BILINE,"1|1^2|1^3|1^4|1",BIAGRPS,.BIERR)
+46 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1",BIAGRPS,.BIERR)
+47 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3",BIAGRPS,.BIERR)
+48 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3",BIAGRPS,.BIERR)
+49 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1",BIAGRPS,.BIERR)
+50 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|3",BIAGRPS,.BIERR)
+51 ;---> Next combo is up to date (UTD); send 5th parameter=1.
+52 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4",BIAGRPS,.BIERR,1)
+53 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|1",BIAGRPS,.BIERR)
+54 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|2^15|3",BIAGRPS,.BIERR)
+55 DO VCOMB^BIREPT3(.BILINE,"1|4^2|3^6|1^3|3^4|3^7|1^11|4^9|2^15|3^10|2",BIAGRPS,.BIERR)
+56 IF $GET(BIERR)]""
DO WRITE^BIREPT3(.BILINE,BIERR)
QUIT
+57 ;
+58 ;---> BITOTPTS (total patients) not newed here because it is also
+59 ;---> used in the Header.
+60 SET BITOTPTS=+$GET(BITMP("STATS","TOTLPTS"))
+61 SET X=" Total Active Patients reviewed"_$JUSTIFY(BITOTPTS,44)
+62 DO WRITE^BIREPT3(.BILINE,X)
+63 DO WRITE^BIREPT3(.BILINE,$$SP^BIUTL5(79,"-"))
+64 ;
+65 ;---> Now write total patients considered who had refusals.
+66 NEW M,N
SET (M,N)=0
FOR
SET M=$ORDER(BITMP("REFUSALS",M))
IF 'M
QUIT
SET N=N+1
+67 SET X=" Total Patients included who had Refusals on record"_$JUSTIFY(N,24)
+68 DO WRITE^BIREPT3(.BILINE,X)
DO WRITE^BIREPT3(.BILINE,$$SP^BIUTL5(79,"-"))
+69 ;
+70 ;---> Set final VALMCNT (Listman line count).
+71 SET VALMCNT=BILINE
+72 QUIT