BIREPE ;IHS/CMI/MWR - REPORT, VAC ELIGIBILITY; MAY 10, 2010
;;8.5;IMMUNIZATION;**2**;MAY 15,2012
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW VACCINE ELIGIBILITY REPORT.
;
;
;----------
START ;EP
;---> Listman Screen for viewing Vaccine Accountability Report.
D SETVARS^BIUTL5 N BIRTN
;
;---> If Vaccine Table is not standard, display Error Text and quit.
I $D(^BISITE(-1)) D ERRCD^BIUTL2(503,,1) Q
;
D EN
D EXIT
Q
;
;
;----------
EN ;EP
;---> Main entry point for BI REPORT VAC ELIGIBILITY.
D EN^VALM("BI REPORT ELIGIBILITY")
Q
;
;
;----------
INIT ;EP
;---> Initialize variables and list array.
K ^TMP("BIREPE",$J)
S VALM("TITLE")=$$LMVER^BILOGO
S VALMSG="Select a left column number to change an item."
N BILINE,X S BILINE=0
D WRITE(.BILINE)
S X=IOUON_"VACCINE ELIGIBILITY REPORT"
D CENTERT^BIUTL5(.X,42)
D WRITE(.BILINE,X_IOINORM)
K X
;
;---> Date Range.
S:'$G(BIBEGDT) BIBEGDT=(DT-10000)
S:'$G(BIENDDT) BIENDDT=DT
;D DATERNG^BIREP(.BILINE,"BIREPE",1,BIBEGDT,BIENDDT)
D DATERNG^BIREP(.BILINE,"BIREPE",1,BIBEGDT,BIENDDT,1,1,1)
;
;---> Current Community.
D DISP^BIREP(.BILINE,"BIREPE",.BICC,"Community",2,1,0)
;
;---> Health Care Facility.
N A,B S A="Health Care Facility",B="Facilities"
D DISP^BIREP(.BILINE,"BIREPE",.BIHCF,A,3,2,0,,,B)
;
;---> Case Manager.
D DISP^BIREP(.BILINE,"BIREPE",.BICM,"Case Manager",4,3)
;
;---> Beneficiary Type.
D DISP^BIREP(.BILINE,"BIREPE",.BIBEN,"Beneficiary Type",5,4,0)
;
;---> Visit Type.
D VTYPE^BIREP(.BILINE,"BIREPE",.BIVT,6)
;
;---> Include Historical.
N BIHIST1 S BIHIST1=""
S:'$D(BIHIST) BIHIST=1
S BIHIST1=$S(BIHIST:"YES",1:"NO")
S X=" 7 - Include Historical.........: "_BIHIST1
D WRITE(.BILINE,X)
K X
;
;---> Include Adults.
N BIU191 S BIU191=""
S:'$D(BIU19) BIU19=0
S BIU191=$S(BIU19:"YES",1:"NO")
S X=" 8 - Include Adults (>19 yrs)...: "_BIU191
D WRITE(.BILINE,X,1)
K X
;
;---> Delimiter.
N BIDELIM1 S BIDELIM1=""
S:'$D(BIDELIM) BIDELIM=2
S BIDELIM1=$S(BIDELIM=2:"2 spaces",1:"caret ^")
S X=" 9 - Delimiter..................: "_BIDELIM1
W ! D WRITE(.BILINE,X)
K X
;
;---> Display by Lot Number.
;N BIDLOT1 S BIDLOT1=""
;S:'$D(BIDLOT) BIDLOT=0
;S BIDLOT1=$S(BIDLOT:"YES",1:"NO")
;S X=" 8 - Display by Lot Number......: "_BIDLOT1
;D WRITE(.BILINE,X)
;K X
;
;
;---> Finish up Listmanager List Count.
S VALMCNT=BILINE
S BIRTN="BIREPE"
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,"BIREPE",$G(BIVAL),$G(BIBLNK))
Q
;
;
;----------
RESET ;EP
;---> Update partition for return to Listmanager.
I $D(VALMQUIT) S VALMBCK="Q" Q
D TERM^VALM0 S VALMBCK="R"
;
;---> NOT USED. Could be used to correct margins.
;K VALMHDR S VALM("BM")=15,VALM("LINES")=14,VALM("TM")=2
D INIT
Q
;
;
;----------
HELP ;EP
;---> Help code.
N BIX S BIX=X
D FULL^VALM1
W !!?5,"Enter ""V"" to view this report on screen, ""P"" to print it,"
W !?5,"or ""H"" to view the Help Text for this report and its parameters."
D DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
D:BIX'="??" RE^VALM4
Q
;
;
;----------
HELP1 ;EP
;----> Explanation of this report.
N BITEXT D TEXT1(.BITEXT)
D START^BIHELP("VACCINE ELIGIBILITY REPORT - HELP",.BITEXT)
Q
;
;
;----------
TEXT1(BITEXT) ;EP
;;The Vaccine Eligibility Report provides a listing of doses
;;administered by date and patient information, along with the
;;patient eligibility recorded for that visit. Lot Number is also
;;displayed. This report can be printed for any time period, for
;;a given facility, visit type, or community(s).
;;
;;There are 9 items or "parameters" on the screen that you may
;;change in order to select for a specific group of patients.
;;To change an item, enter its left column number (1-8) at the
;;prompt on the bottom of the screen. Use "?" at any prompt where
;;you would like help or more information on the parameter you are
;;changing.
;;
;;Once you have the parameters set to retrieve the group of patients
;;you want, select V to View the Vaccine Elig Report or P to print it.
;;
;;If it customarily takes a long time for your computer to prepare
;;this report, it may be preferable to Print and Queue the report
;;to a printer, rather than Viewing it on screen. (This would avoid
;;tying up your screen while the report is being prepared.)
;;
;;DATE RANGE: Only immunizations given within the Date Range you
;;select will be included in the report.
;;
;;COMMUNITIES: If you select for specific Communities, only patients
;;whose Current Community matches one of the Communities selected will
;;be included in the report. "Current Community" refers to Item 6
;;on Page 1 of the RPMS Patient Registration.
;;
;;HEALTH CARE FACILITIES: If you select for specific Health Care
;;Facilities, only immunizations given at the selected Health Care
;;Facilities will be included in the report.
;;
;;CASE MANAGERS: If you select for specific Case Managers, only
;;patients who have the selected Case Managers will be included
;;in the report.
;;
;;BENEFICIARY TYPES: If you select for specific Beneficiary Types,
;;only patients whose Beneficiary Type is one of those you select
;;will be included in the report. "Beneficiary Type" refers to
;;Item 3 on Page 2 of the RPMS Patient Registration.
;;
;;VISIT TYPES: If you select for specific Visit Types, only visits
;;that are classifed with one of the Visit Types you select will
;;included in the report.
;;
;;INCLUDE HISTORICAL: If this parameter is set to "YES", then Visits
;;with a Category of "Historical" will be counted in the Vaccine
;;Eligibility Report. (Category is displayed and edited on the
;;ADD/EDIT IMMUNIZATION VISIT Screen.) If set to "NO", they will
;;not be counted in the report.
;;
;;INCLUDE ADULTS: If this parameter is set to "YES", then immunizations
;;given when the patietn was age 19 years or older will be included.
;;Otherwise, only immunizations given when the patient was younger
;;than 19 years of age will be included.
;;
;;DELIMITER: This parameter allows you to select the character that
;;will separate the 6 fields in each record displayed by the report.
;;The default delimiter is "2 spaces". However, when the intention is
;;to print or copy the report to a text file for the purpose of importing
;;it into Excel or some other spreadsheet, use of the caret "^" is
;;preferable and recommended. (Spaces in the data itself might sometimes
;;be confused with spaces in the delimiter and/or spaces used to make the
;;columns line up.)
;;
D LOADTX("TEXT1",,.BITEXT)
Q
;
;;DISPLAY BY LOT NUMBERS: The report lists the statistics by age for
;;each vaccine. However, you may elect to display the statistics for
;;each separate lot number under each vaccine. The totals for all
;;lot numbers of each vaccine will also be displayed.
;;
;
;
;----------
LOADTX(BILINL,BITAB,BITEXT) ;EP
Q:$G(BILINL)=""
N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
F I=1:1 S X=$T(@BILINL+I) Q:X'[";;" S BITEXT(I)=T_$P(X,";;",2)
Q
;
;
;----------
EXIT ;EP
;---> End of job cleanup.
D KILLALL^BIUTL8(1)
K ^TMP("BIREPE",$J)
D CLEAR^VALM1
Q
BIREPE ;IHS/CMI/MWR - REPORT, VAC ELIGIBILITY; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;**2**;MAY 15,2012
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW VACCINE ELIGIBILITY REPORT.
+4 ;
+5 ;
+6 ;----------
START ;EP
+1 ;---> Listman Screen for viewing Vaccine Accountability Report.
+2 DO SETVARS^BIUTL5
NEW BIRTN
+3 ;
+4 ;---> If Vaccine Table is not standard, display Error Text and quit.
+5 IF $DATA(^BISITE(-1))
DO ERRCD^BIUTL2(503,,1)
QUIT
+6 ;
+7 DO EN
+8 DO EXIT
+9 QUIT
+10 ;
+11 ;
+12 ;----------
EN ;EP
+1 ;---> Main entry point for BI REPORT VAC ELIGIBILITY.
+2 DO EN^VALM("BI REPORT ELIGIBILITY")
+3 QUIT
+4 ;
+5 ;
+6 ;----------
INIT ;EP
+1 ;---> Initialize variables and list array.
+2 KILL ^TMP("BIREPE",$JOB)
+3 SET VALM("TITLE")=$$LMVER^BILOGO
+4 SET VALMSG="Select a left column number to change an item."
+5 NEW BILINE,X
SET BILINE=0
+6 DO WRITE(.BILINE)
+7 SET X=IOUON_"VACCINE ELIGIBILITY REPORT"
+8 DO CENTERT^BIUTL5(.X,42)
+9 DO WRITE(.BILINE,X_IOINORM)
+10 KILL X
+11 ;
+12 ;---> Date Range.
+13 IF '$GET(BIBEGDT)
SET BIBEGDT=(DT-10000)
+14 IF '$GET(BIENDDT)
SET BIENDDT=DT
+15 ;D DATERNG^BIREP(.BILINE,"BIREPE",1,BIBEGDT,BIENDDT)
+16 DO DATERNG^BIREP(.BILINE,"BIREPE",1,BIBEGDT,BIENDDT,1,1,1)
+17 ;
+18 ;---> Current Community.
+19 DO DISP^BIREP(.BILINE,"BIREPE",.BICC,"Community",2,1,0)
+20 ;
+21 ;---> Health Care Facility.
+22 NEW A,B
SET A="Health Care Facility"
SET B="Facilities"
+23 DO DISP^BIREP(.BILINE,"BIREPE",.BIHCF,A,3,2,0,,,B)
+24 ;
+25 ;---> Case Manager.
+26 DO DISP^BIREP(.BILINE,"BIREPE",.BICM,"Case Manager",4,3)
+27 ;
+28 ;---> Beneficiary Type.
+29 DO DISP^BIREP(.BILINE,"BIREPE",.BIBEN,"Beneficiary Type",5,4,0)
+30 ;
+31 ;---> Visit Type.
+32 DO VTYPE^BIREP(.BILINE,"BIREPE",.BIVT,6)
+33 ;
+34 ;---> Include Historical.
+35 NEW BIHIST1
SET BIHIST1=""
+36 IF '$DATA(BIHIST)
SET BIHIST=1
+37 SET BIHIST1=$SELECT(BIHIST:"YES",1:"NO")
+38 SET X=" 7 - Include Historical.........: "_BIHIST1
+39 DO WRITE(.BILINE,X)
+40 KILL X
+41 ;
+42 ;---> Include Adults.
+43 NEW BIU191
SET BIU191=""
+44 IF '$DATA(BIU19)
SET BIU19=0
+45 SET BIU191=$SELECT(BIU19:"YES",1:"NO")
+46 SET X=" 8 - Include Adults (>19 yrs)...: "_BIU191
+47 DO WRITE(.BILINE,X,1)
+48 KILL X
+49 ;
+50 ;---> Delimiter.
+51 NEW BIDELIM1
SET BIDELIM1=""
+52 IF '$DATA(BIDELIM)
SET BIDELIM=2
+53 SET BIDELIM1=$SELECT(BIDELIM=2:"2 spaces",1:"caret ^")
+54 SET X=" 9 - Delimiter..................: "_BIDELIM1
+55 WRITE !
DO WRITE(.BILINE,X)
+56 KILL X
+57 ;
+58 ;---> Display by Lot Number.
+59 ;N BIDLOT1 S BIDLOT1=""
+60 ;S:'$D(BIDLOT) BIDLOT=0
+61 ;S BIDLOT1=$S(BIDLOT:"YES",1:"NO")
+62 ;S X=" 8 - Display by Lot Number......: "_BIDLOT1
+63 ;D WRITE(.BILINE,X)
+64 ;K X
+65 ;
+66 ;
+67 ;---> Finish up Listmanager List Count.
+68 SET VALMCNT=BILINE
+69 SET BIRTN="BIREPE"
+70 QUIT
+71 ;
+72 ;
+73 ;----------
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,"BIREPE",$GET(BIVAL),$GET(BIBLNK))
+9 QUIT
+10 ;
+11 ;
+12 ;----------
RESET ;EP
+1 ;---> Update partition for return to Listmanager.
+2 IF $DATA(VALMQUIT)
SET VALMBCK="Q"
QUIT
+3 DO TERM^VALM0
SET VALMBCK="R"
+4 ;
+5 ;---> NOT USED. Could be used to correct margins.
+6 ;K VALMHDR S VALM("BM")=15,VALM("LINES")=14,VALM("TM")=2
+7 DO INIT
+8 QUIT
+9 ;
+10 ;
+11 ;----------
HELP ;EP
+1 ;---> Help code.
+2 NEW BIX
SET BIX=X
+3 DO FULL^VALM1
+4 WRITE !!?5,"Enter ""V"" to view this report on screen, ""P"" to print it,"
+5 WRITE !?5,"or ""H"" to view the Help Text for this report and its parameters."
+6 DO DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
+7 IF BIX'="??"
DO RE^VALM4
+8 QUIT
+9 ;
+10 ;
+11 ;----------
HELP1 ;EP
+1 ;----> Explanation of this report.
+2 NEW BITEXT
DO TEXT1(.BITEXT)
+3 DO START^BIHELP("VACCINE ELIGIBILITY REPORT - HELP",.BITEXT)
+4 QUIT
+5 ;
+6 ;
+7 ;----------
TEXT1(BITEXT) ;EP
+1 ;;The Vaccine Eligibility Report provides a listing of doses
+2 ;;administered by date and patient information, along with the
+3 ;;patient eligibility recorded for that visit. Lot Number is also
+4 ;;displayed. This report can be printed for any time period, for
+5 ;;a given facility, visit type, or community(s).
+6 ;;
+7 ;;There are 9 items or "parameters" on the screen that you may
+8 ;;change in order to select for a specific group of patients.
+9 ;;To change an item, enter its left column number (1-8) at the
+10 ;;prompt on the bottom of the screen. Use "?" at any prompt where
+11 ;;you would like help or more information on the parameter you are
+12 ;;changing.
+13 ;;
+14 ;;Once you have the parameters set to retrieve the group of patients
+15 ;;you want, select V to View the Vaccine Elig Report or P to print it.
+16 ;;
+17 ;;If it customarily takes a long time for your computer to prepare
+18 ;;this report, it may be preferable to Print and Queue the report
+19 ;;to a printer, rather than Viewing it on screen. (This would avoid
+20 ;;tying up your screen while the report is being prepared.)
+21 ;;
+22 ;;DATE RANGE: Only immunizations given within the Date Range you
+23 ;;select will be included in the report.
+24 ;;
+25 ;;COMMUNITIES: If you select for specific Communities, only patients
+26 ;;whose Current Community matches one of the Communities selected will
+27 ;;be included in the report. "Current Community" refers to Item 6
+28 ;;on Page 1 of the RPMS Patient Registration.
+29 ;;
+30 ;;HEALTH CARE FACILITIES: If you select for specific Health Care
+31 ;;Facilities, only immunizations given at the selected Health Care
+32 ;;Facilities will be included in the report.
+33 ;;
+34 ;;CASE MANAGERS: If you select for specific Case Managers, only
+35 ;;patients who have the selected Case Managers will be included
+36 ;;in the report.
+37 ;;
+38 ;;BENEFICIARY TYPES: If you select for specific Beneficiary Types,
+39 ;;only patients whose Beneficiary Type is one of those you select
+40 ;;will be included in the report. "Beneficiary Type" refers to
+41 ;;Item 3 on Page 2 of the RPMS Patient Registration.
+42 ;;
+43 ;;VISIT TYPES: If you select for specific Visit Types, only visits
+44 ;;that are classifed with one of the Visit Types you select will
+45 ;;included in the report.
+46 ;;
+47 ;;INCLUDE HISTORICAL: If this parameter is set to "YES", then Visits
+48 ;;with a Category of "Historical" will be counted in the Vaccine
+49 ;;Eligibility Report. (Category is displayed and edited on the
+50 ;;ADD/EDIT IMMUNIZATION VISIT Screen.) If set to "NO", they will
+51 ;;not be counted in the report.
+52 ;;
+53 ;;INCLUDE ADULTS: If this parameter is set to "YES", then immunizations
+54 ;;given when the patietn was age 19 years or older will be included.
+55 ;;Otherwise, only immunizations given when the patient was younger
+56 ;;than 19 years of age will be included.
+57 ;;
+58 ;;DELIMITER: This parameter allows you to select the character that
+59 ;;will separate the 6 fields in each record displayed by the report.
+60 ;;The default delimiter is "2 spaces". However, when the intention is
+61 ;;to print or copy the report to a text file for the purpose of importing
+62 ;;it into Excel or some other spreadsheet, use of the caret "^" is
+63 ;;preferable and recommended. (Spaces in the data itself might sometimes
+64 ;;be confused with spaces in the delimiter and/or spaces used to make the
+65 ;;columns line up.)
+66 ;;
+67 DO LOADTX("TEXT1",,.BITEXT)
+68 QUIT
+69 ;
+70 ;;DISPLAY BY LOT NUMBERS: The report lists the statistics by age for
+71 ;;each vaccine. However, you may elect to display the statistics for
+72 ;;each separate lot number under each vaccine. The totals for all
+73 ;;lot numbers of each vaccine will also be displayed.
+74 ;;
+75 ;
+76 ;
+77 ;----------
LOADTX(BILINL,BITAB,BITEXT) ;EP
+1 IF $GET(BILINL)=""
QUIT
+2 NEW I,T,X
SET T=""
IF '$DATA(BITAB)
SET BITAB=5
FOR I=1:1:BITAB
SET T=T_" "
+3 FOR I=1:1
SET X=$TEXT(@BILINL+I)
IF X'[";;"
QUIT
SET BITEXT(I)=T_$PIECE(X,";;",2)
+4 QUIT
+5 ;
+6 ;
+7 ;----------
EXIT ;EP
+1 ;---> End of job cleanup.
+2 DO KILLALL^BIUTL8(1)
+3 KILL ^TMP("BIREPE",$JOB)
+4 DO CLEAR^VALM1
+5 QUIT