BIREPH ;IHS/CMI/MWR - REPORT, H1N1 ACCOUNTABILITY; AUG 10,2010
;;8.5;IMMUNIZATION;;SEP 01,2011
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW H1N1 ACCOUNTABILITY REPORT.
;; v8.3 PATCH 3: BIREPH* routines are completely new for H1N1 Report.
;; v8.4 PATCH 1: EXPLAIN time frame of report: 8/1/09 to 8/31/10. TEXT1+21
;
;
;----------
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 ACCOUNTABILITY.
D EN^VALM("BI REPORT H1N1")
Q
;
;
;----------
INIT ;EP
;---> Initialize variables and list array.
K ^TMP("BIREPH",$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_"H1N1 ACCOUNTABILITY REPORT"
D CENTERT^BIUTL5(.X,42)
D WRITE(.BILINE,X_IOINORM)
K X
;
;---> Date Range.
D
.;---> Quit if dates have already been selected.
.Q:$G(BIBEGDT)
.;---> Default: A week before the previous Sunday to the next Saturday.
.N X,X1,X2 S X=DT D H^%DTC
.S X1=DT,X2=-(%Y+7) D C^%DTC S BIBEGDT=X
.S X1=X,X2=6 D C^%DTC S BIENDDT=X
;
;D DATERNG^BIREP(.BILINE,"BIREPH",1,BIBEGDT,BIENDDT)
;
D DATERNG^BIREP(.BILINE,"BIREPH",1,BIBEGDT,BIENDDT,1,1,1)
;
;---> Current Community.
D DISP^BIREP(.BILINE,"BIREPH",.BICC,"Community",2,1)
;
;---> Health Care Facility.
N A,B S A="Health Care Facility",B="Facilities"
D DISP^BIREP(.BILINE,"BIREPH",.BIHCF,A,3,2,,,,B)
;
;---> Case Manager.
D DISP^BIREP(.BILINE,"BIREPH",.BICM,"Case Manager",4,3)
;
;---> Beneficiary Type.
D DISP^BIREP(.BILINE,"BIREPH",.BIBEN,"Beneficiary Type",5,4)
;
;---> Visit Type.
D VTYPE^BIREP(.BILINE,"BIREPH",.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
;
;
;---> Finish up Listmanager List Count.
S VALMCNT=BILINE
S BIRTN="BIREPH"
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).
;
Q:'$D(BILINE)
D WL^BIW(.BILINE,"BIREPH",$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 ACCOUNTABILITY REPORT - HELP",.BITEXT)
Q
;
;
;
;********** PATCH 1, v8.4, AUG 01,2010, IHS/CMI/MWR
;---> Explain time frame of report from 8/1/09 to 8/31/10. TEXT1+21
;
;----------
TEXT1(BITEXT) ;EP
;;The H1n1 Accountability Report provides "doses administered"
;;by age group. This report can be printed for any time period,
;;for a given facility, visit type, or community(s).
;;
;;There are 7 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-7) 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 Acct 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. The maximum date range that
;;will be examined is 8/1/09 to 8/31/10.
;;
;;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" is 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 H1N1
;;Accountability 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.
;;
D LOADTX("TEXT1",,.BITEXT)
Q
;
;
;----------
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("BIREPH",$J),^TMP("BIDFN",$J)
D CLEAR^VALM1
Q
BIREPH ;IHS/CMI/MWR - REPORT, H1N1 ACCOUNTABILITY; AUG 10,2010
+1 ;;8.5;IMMUNIZATION;;SEP 01,2011
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW H1N1 ACCOUNTABILITY REPORT.
+4 ;; v8.3 PATCH 3: BIREPH* routines are completely new for H1N1 Report.
+5 ;; v8.4 PATCH 1: EXPLAIN time frame of report: 8/1/09 to 8/31/10. TEXT1+21
+6 ;
+7 ;
+8 ;----------
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 ACCOUNTABILITY.
+2 DO EN^VALM("BI REPORT H1N1")
+3 QUIT
+4 ;
+5 ;
+6 ;----------
INIT ;EP
+1 ;---> Initialize variables and list array.
+2 KILL ^TMP("BIREPH",$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_"H1N1 ACCOUNTABILITY REPORT"
+8 DO CENTERT^BIUTL5(.X,42)
+9 DO WRITE(.BILINE,X_IOINORM)
+10 KILL X
+11 ;
+12 ;---> Date Range.
+13 Begin DoDot:1
+14 ;---> Quit if dates have already been selected.
+15 IF $GET(BIBEGDT)
QUIT
+16 ;---> Default: A week before the previous Sunday to the next Saturday.
+17 NEW X,X1,X2
SET X=DT
DO H^%DTC
+18 SET X1=DT
SET X2=-(%Y+7)
DO C^%DTC
SET BIBEGDT=X
+19 SET X1=X
SET X2=6
DO C^%DTC
SET BIENDDT=X
End DoDot:1
+20 ;
+21 ;D DATERNG^BIREP(.BILINE,"BIREPH",1,BIBEGDT,BIENDDT)
+22 ;
+23 DO DATERNG^BIREP(.BILINE,"BIREPH",1,BIBEGDT,BIENDDT,1,1,1)
+24 ;
+25 ;---> Current Community.
+26 DO DISP^BIREP(.BILINE,"BIREPH",.BICC,"Community",2,1)
+27 ;
+28 ;---> Health Care Facility.
+29 NEW A,B
SET A="Health Care Facility"
SET B="Facilities"
+30 DO DISP^BIREP(.BILINE,"BIREPH",.BIHCF,A,3,2,,,,B)
+31 ;
+32 ;---> Case Manager.
+33 DO DISP^BIREP(.BILINE,"BIREPH",.BICM,"Case Manager",4,3)
+34 ;
+35 ;---> Beneficiary Type.
+36 DO DISP^BIREP(.BILINE,"BIREPH",.BIBEN,"Beneficiary Type",5,4)
+37 ;
+38 ;---> Visit Type.
+39 DO VTYPE^BIREP(.BILINE,"BIREPH",.BIVT,6)
+40 ;
+41 ;---> Include Historical.
+42 NEW BIHIST1
SET BIHIST1=""
+43 IF '$DATA(BIHIST)
SET BIHIST=1
+44 SET BIHIST1=$SELECT(BIHIST:"YES",1:"NO")
+45 SET X=" 7 - Include Historical.........: "_BIHIST1
+46 DO WRITE(.BILINE,X)
+47 KILL X
+48 ;
+49 ;
+50 ;---> Finish up Listmanager List Count.
+51 SET VALMCNT=BILINE
+52 SET BIRTN="BIREPH"
+53 QUIT
+54 ;
+55 ;
+56 ;----------
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 ;
+6 IF '$DATA(BILINE)
QUIT
+7 DO WL^BIW(.BILINE,"BIREPH",$GET(BIVAL),$GET(BIBLNK))
+8 QUIT
+9 ;
+10 ;
+11 ;----------
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 ACCOUNTABILITY REPORT - HELP",.BITEXT)
+4 QUIT
+5 ;
+6 ;
+7 ;
+8 ;********** PATCH 1, v8.4, AUG 01,2010, IHS/CMI/MWR
+9 ;---> Explain time frame of report from 8/1/09 to 8/31/10. TEXT1+21
+10 ;
+11 ;----------
TEXT1(BITEXT) ;EP
+1 ;;The H1n1 Accountability Report provides "doses administered"
+2 ;;by age group. This report can be printed for any time period,
+3 ;;for a given facility, visit type, or community(s).
+4 ;;
+5 ;;There are 7 items or "parameters" on the screen that you may
+6 ;;change in order to select for a specific group of patients.
+7 ;;To change an item, enter its left column number (1-7) at the
+8 ;;prompt on the bottom of the screen. Use "?" at any prompt where
+9 ;;you would like help or more information on the parameter you are
+10 ;;changing.
+11 ;;
+12 ;;Once you have the parameters set to retrieve the group of patients
+13 ;;you want, select V to View the Vaccine Acct Report or P to print it.
+14 ;;
+15 ;;If it customarily takes a long time for your computer to prepare
+16 ;;this report, it may be preferable to Print and Queue the report
+17 ;;to a printer, rather than Viewing it on screen. (This would avoid
+18 ;;tying up your screen while the report is being prepared.)
+19 ;;
+20 ;;DATE RANGE: Only immunizations given within the Date Range you
+21 ;;select will be included in the report. The maximum date range that
+22 ;;will be examined is 8/1/09 to 8/31/10.
+23 ;;
+24 ;;COMMUNITIES: If you select for specific Communities, only patients
+25 ;;whose Current Community matches one of the Communities selected will
+26 ;;be included in the report. "Current Community" is refers to Item 6
+27 ;;on Page 1 of the RPMS Patient Registration.
+28 ;;
+29 ;;HEALTH CARE FACILITIES: If you select for specific Health Care
+30 ;;Facilities, only immunizations given at the selected Health Care
+31 ;;Facilities will be included in the report.
+32 ;;
+33 ;;CASE MANAGERS: If you select for specific Case Managers, only
+34 ;;patients who have the selected Case Managers will be included
+35 ;;in the report.
+36 ;;
+37 ;;BENEFICIARY TYPES: If you select for specific Beneficiary Types,
+38 ;;only patients whose Beneficiary Type is one of those you select
+39 ;;will be included in the report. "Beneficiary Type" refers to
+40 ;;Item 3 on Page 2 of the RPMS Patient Registration.
+41 ;;
+42 ;;VISIT TYPES: If you select for specific Visit Types, only visits
+43 ;;that are classifed with one of the Visit Types you select will
+44 ;;included in the report.
+45 ;;
+46 ;;INCLUDE HISTORICAL: If this parameter is set to "YES", then Visits
+47 ;;with a Category of "Historical" will be counted in the H1N1
+48 ;;Accountability Report. (Category is displayed and edited on the
+49 ;;ADD/EDIT IMMUNIZATION VISIT Screen.) If set to "NO", they will
+50 ;;not be counted in the report.
+51 ;;
+52 DO LOADTX("TEXT1",,.BITEXT)
+53 QUIT
+54 ;
+55 ;
+56 ;----------
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("BIREPH",$JOB),^TMP("BIDFN",$JOB)
+4 DO CLEAR^VALM1
+5 QUIT