BIREPP1 ;IHS/CMI/MWR - REPORT, PCV; MAY 10, 2010
;;8.5;IMMUNIZATION;;SEP 01,2011
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW OR PRINT PCV REPORT.
;
;
;----------
START(BIX) ;EP
;---> Prepare and display or print PCV Report.
;---> Parameters:
; 1 - BIX (req) If BIX="PRINT", then print Report.
; If BIX="VIEW", then view Report (default).
;---> Variables:
; 1 - BIBEGDT (req) Begin date of report.
; 2 - BIENDDT (req) End date of report.
; 3 - BICC (req) Current Community array.
; 4 - BIUP (req) User Population/Group (r,i,u,a).
; (Registered, Imm Reg Active, User 1+, Active 2+).
;
; NOT USED FOR NOW.
; 4 - BIHCF (req) Health Care Facility array.
; 5 - BICM (req) Case Manager array.
; 6 - BIBEN (req) Beneficiary Type array.
; 7 - BIHIST (req) Include Historical (1=yes,0=no).
; 8 - BIVT (req) Visit Type array.
; 9 - BIPOP (ret) BIPOP=1 if error.
;
;---> Check for required Variables.
I '$G(BIBEGDT) D ERROR(626) D RESET^BIREPP Q
I '$G(BIENDDT) D ERROR(627) D RESET^BIREPP Q
I '$D(BICC) D ERROR(614) D RESET^BIREPP Q
;I '$D(BIHCF) D ERROR(625) D RESET^BIREPP Q
;
;
S:$G(BIUP)="" BIUP="u"
S BIAGRPS="0059,0223,2459,0611,1223"
;
;---> BITOTPTS=Total Patients, used by HDR code after EN.
N BINOUP,BIRTN,BITOTPTS,BITOTFPT
S BIRTN="BIREPP1"
;
D SETVARS^BIUTL5
N VALMCNT
I $G(BIX)="PRINT" D PRINT,RESET^BIREPP Q
D EN
Q
;
;
;----------
PRINT ;EP
;---> Main entry point for printing the Quarterly Immunization Report.
D DEVICE(.BIPOP)
Q:$G(BIPOP)
;
D:$G(IO)'=$G(IO(0))
.W !!?10,"This may take some time. Please hold on...",!
;
;---> Prepare report.
K VALMHDR,^TMP("BIREPP1",$J),^TMP("BIDUL",$J)
N VALM,VALMHDR
D HDR
D GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
D DISPLAY^BIREPP2
D PRTLST^BIUTL8("BIREPP1")
D EXIT ;,RESET^BIREPP
Q
;
;
;----------
EN ;EP
;---> Main entry point for List Template BI REPORT QUARTERLY IMM1.
D EN^VALM("BI REPORT PCV1")
Q
;
;
;----------
HDR ;EP
;---> Header code
D HEAD^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
Q
;
;
;----------
INIT ;EP
;---> Initialize variables and list array.
;---> Local Variable:
; 1 - BINOUP (opt) If BINOUP=1, then do NOT update.
;
S VALM("TITLE")=$$LMVER^BILOGO
W !!?10,"This may take some time. Please hold on...",!
D:'$G(BINOUP) GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
D DISPLAY^BIREPP2
;---> Set up ZTSAVE in case user Queues from PL in List.
D ZSAVES^BIUTL3
Q
;
;
;----------
RESET ;EP
;---> Update partition for return to Listmanager.
;---> Local Variable:
; 1 - BINOUP (opt) If BINOUP=1, then do NOT update.
;
I $D(VALMQUIT) S VALMBCK="Q" Q
D TERM^VALM0 S VALMBCK="R"
D INIT,HDR Q
;
;
;----------
HELP ;EP
;---> Help code.
N BIX S BIX=X
D FULL^VALM1
W !!?5,"Use arrow keys to scroll up and down through the report, or"
W !?5,"type ""??"" for more actions, such as Search and Print List."
D DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
D:BIX'="??" RE^VALM4
Q
;
;
;----------
EXIT ;EP
;---> Cleanup, EOJ.
K ^TMP("BIREPP1",$J),^TMP("BIDFN",$J),^TMP("BIDUL",$J)
D CLEAR^VALM1
D FULL^VALM1
Q
;
;
;----------
DEVICE(BIPOP) ;EP
;---> Get Device and possibly queue to Taskman.
;---> Parameters:
; 1 - BIPOP (ret) If error or Queue, BIPOP=1
;
K %ZIS,IOP S BIPOP=0
S ZTRTN="DEQUEUE^BIREPP1"
D ZSAVES^BIUTL3
D ZIS^BIUTL2(.BIPOP,1)
Q
;
;
;----------
DEQUEUE ;EP
;---> Prepare and print Quarterly Report.
K VALMHDR,^TMP("BIREPP1",$J),^TMP("BIDUL",$J)
D HDR
D GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
D DISPLAY^BIREPP2
D PRTLST^BIUTL8("BIREPP1"),EXIT
Q
;
;
;----------
ERROR(BIERR) ;EP
;---> Report error, either to screen or print.
;---> Parameters:
; 1 - BIERR (ret) Text of Error Code if any, otherwise null.
;
D ERRCD^BIUTL2($G(BIERR),,1) S BIPOP=1
Q
BIREPP1 ;IHS/CMI/MWR - REPORT, PCV; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;;SEP 01,2011
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW OR PRINT PCV REPORT.
+4 ;
+5 ;
+6 ;----------
START(BIX) ;EP
+1 ;---> Prepare and display or print PCV Report.
+2 ;---> Parameters:
+3 ; 1 - BIX (req) If BIX="PRINT", then print Report.
+4 ; If BIX="VIEW", then view Report (default).
+5 ;---> Variables:
+6 ; 1 - BIBEGDT (req) Begin date of report.
+7 ; 2 - BIENDDT (req) End date of report.
+8 ; 3 - BICC (req) Current Community array.
+9 ; 4 - BIUP (req) User Population/Group (r,i,u,a).
+10 ; (Registered, Imm Reg Active, User 1+, Active 2+).
+11 ;
+12 ; NOT USED FOR NOW.
+13 ; 4 - BIHCF (req) Health Care Facility array.
+14 ; 5 - BICM (req) Case Manager array.
+15 ; 6 - BIBEN (req) Beneficiary Type array.
+16 ; 7 - BIHIST (req) Include Historical (1=yes,0=no).
+17 ; 8 - BIVT (req) Visit Type array.
+18 ; 9 - BIPOP (ret) BIPOP=1 if error.
+19 ;
+20 ;---> Check for required Variables.
+21 IF '$GET(BIBEGDT)
DO ERROR(626)
DO RESET^BIREPP
QUIT
+22 IF '$GET(BIENDDT)
DO ERROR(627)
DO RESET^BIREPP
QUIT
+23 IF '$DATA(BICC)
DO ERROR(614)
DO RESET^BIREPP
QUIT
+24 ;I '$D(BIHCF) D ERROR(625) D RESET^BIREPP Q
+25 ;
+26 ;
+27 IF $GET(BIUP)=""
SET BIUP="u"
+28 SET BIAGRPS="0059,0223,2459,0611,1223"
+29 ;
+30 ;---> BITOTPTS=Total Patients, used by HDR code after EN.
+31 NEW BINOUP,BIRTN,BITOTPTS,BITOTFPT
+32 SET BIRTN="BIREPP1"
+33 ;
+34 DO SETVARS^BIUTL5
+35 NEW VALMCNT
+36 IF $GET(BIX)="PRINT"
DO PRINT
DO RESET^BIREPP
QUIT
+37 DO EN
+38 QUIT
+39 ;
+40 ;
+41 ;----------
PRINT ;EP
+1 ;---> Main entry point for printing the Quarterly Immunization Report.
+2 DO DEVICE(.BIPOP)
+3 IF $GET(BIPOP)
QUIT
+4 ;
+5 IF $GET(IO)'=$GET(IO(0))
Begin DoDot:1
+6 WRITE !!?10,"This may take some time. Please hold on...",!
End DoDot:1
+7 ;
+8 ;---> Prepare report.
+9 KILL VALMHDR,^TMP("BIREPP1",$JOB),^TMP("BIDUL",$JOB)
+10 NEW VALM,VALMHDR
+11 DO HDR
+12 DO GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
+13 DO DISPLAY^BIREPP2
+14 DO PRTLST^BIUTL8("BIREPP1")
+15 ;,RESET^BIREPP
DO EXIT
+16 QUIT
+17 ;
+18 ;
+19 ;----------
EN ;EP
+1 ;---> Main entry point for List Template BI REPORT QUARTERLY IMM1.
+2 DO EN^VALM("BI REPORT PCV1")
+3 QUIT
+4 ;
+5 ;
+6 ;----------
HDR ;EP
+1 ;---> Header code
+2 DO HEAD^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
+3 QUIT
+4 ;
+5 ;
+6 ;----------
INIT ;EP
+1 ;---> Initialize variables and list array.
+2 ;---> Local Variable:
+3 ; 1 - BINOUP (opt) If BINOUP=1, then do NOT update.
+4 ;
+5 SET VALM("TITLE")=$$LMVER^BILOGO
+6 WRITE !!?10,"This may take some time. Please hold on...",!
+7 IF '$GET(BINOUP)
DO GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
+8 DO DISPLAY^BIREPP2
+9 ;---> Set up ZTSAVE in case user Queues from PL in List.
+10 DO ZSAVES^BIUTL3
+11 QUIT
+12 ;
+13 ;
+14 ;----------
RESET ;EP
+1 ;---> Update partition for return to Listmanager.
+2 ;---> Local Variable:
+3 ; 1 - BINOUP (opt) If BINOUP=1, then do NOT update.
+4 ;
+5 IF $DATA(VALMQUIT)
SET VALMBCK="Q"
QUIT
+6 DO TERM^VALM0
SET VALMBCK="R"
+7 DO INIT
DO HDR
QUIT
+8 ;
+9 ;
+10 ;----------
HELP ;EP
+1 ;---> Help code.
+2 NEW BIX
SET BIX=X
+3 DO FULL^VALM1
+4 WRITE !!?5,"Use arrow keys to scroll up and down through the report, or"
+5 WRITE !?5,"type ""??"" for more actions, such as Search and Print List."
+6 DO DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
+7 IF BIX'="??"
DO RE^VALM4
+8 QUIT
+9 ;
+10 ;
+11 ;----------
EXIT ;EP
+1 ;---> Cleanup, EOJ.
+2 KILL ^TMP("BIREPP1",$JOB),^TMP("BIDFN",$JOB),^TMP("BIDUL",$JOB)
+3 DO CLEAR^VALM1
+4 DO FULL^VALM1
+5 QUIT
+6 ;
+7 ;
+8 ;----------
DEVICE(BIPOP) ;EP
+1 ;---> Get Device and possibly queue to Taskman.
+2 ;---> Parameters:
+3 ; 1 - BIPOP (ret) If error or Queue, BIPOP=1
+4 ;
+5 KILL %ZIS,IOP
SET BIPOP=0
+6 SET ZTRTN="DEQUEUE^BIREPP1"
+7 DO ZSAVES^BIUTL3
+8 DO ZIS^BIUTL2(.BIPOP,1)
+9 QUIT
+10 ;
+11 ;
+12 ;----------
DEQUEUE ;EP
+1 ;---> Prepare and print Quarterly Report.
+2 KILL VALMHDR,^TMP("BIREPP1",$JOB),^TMP("BIDUL",$JOB)
+3 DO HDR
+4 DO GET^BIREPP2(BIBEGDT,BIENDDT,.BICC,BIUP)
+5 DO DISPLAY^BIREPP2
+6 DO PRTLST^BIUTL8("BIREPP1")
DO EXIT
+7 QUIT
+8 ;
+9 ;
+10 ;----------
ERROR(BIERR) ;EP
+1 ;---> Report error, either to screen or print.
+2 ;---> Parameters:
+3 ; 1 - BIERR (ret) Text of Error Code if any, otherwise null.
+4 ;
+5 DO ERRCD^BIUTL2($GET(BIERR),,1)
SET BIPOP=1
+6 QUIT