BIOUTPT3 ;IHS/CMI/MWR - PROMPTS FOR REPORTS.; MAY 10, 2010
;;8.5;IMMUNIZATION;**9**;OCT 01,2014
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; PROMPTS FOR REPORT PARAMETERS.
;; PATCH 1: Clarify Date Range on Imms Received with added prompt. IMMRCV+20
;; PATCH 2: Add two more questions, U19 and DELIM.
;; PATCH 9: Corrected spelling and setting of parameter BIMMRF. IMMRCV+0
;
;
;----------
MINDAYS(BIMD,BIPOP) ;EP
;---> Select Minimum Number of days since last letter sent.
;---> Called by routine BIDUPLT.
;---> Parameters:
; 1 - BIMD (ret) Minimum Days since Last Letter.
; 2 - BIPOP (ret) BIPOP=1 if DTOUT or DUOUT
;
D FULL^VALM1
D TITLE^BIUTL5("SELECT MINIMUM DAYS SINCE LAST LETTER")
W !!?3,"Please specify the minimum number of days between a patient's"
W !?3,"previous letter and today's letter."
W !?3,"Type ""?"" (no quotes) for further explanation.",!!
N DIR,DIRUT D HELP2
S DIR(0)="NOA^0:9999:0"
S DIR("A")=" Enter Number of Days: "
S DIR("B")=$$MINDAYS^BIUTL2(DUZ(2))
D FULL^VALM1
D ^DIR
I $D(DIRUT) S BIPOP=1 Q
S BIMD=+Y S:BIMD<0 BIMD=$$MINDAYS^BIUTL2(DUZ(2))
Q
;
;
;----------
HELP2 ;EP
;;The Minimum Days Since Last Letter is the least number of days that
;;must elapse--after a letter has been sent to a patient--before the
;;software will automatically send another letter to that same patient.
;;
;;For example, if a patient received a letter 2 weeks ago and
;;the Minimum Days Last Letter is 60 days, then this software will
;;not generate a new letter for that patient today, even if the patient
;;fits the other criteria you have selected for Age, Community,
;;Immunizations Due, etc.
D HELPTX("HELP2")
Q
;
;
;----------
LOTNUM(BILOT,BIRTN) ;EP
;---> Select Lot Numbers.
;---> Called by Protocol BI OUTPUT LOT NUMBER.
;---> Parameters:
; 1 - BILOT (ret) Local array of Lot Number IENs.
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
;---> Select cases for one or more LOT NUMBERS (OR ALL).
N BIID S BIID="2;I $G(X) S:$D(^AUTTIMAN(X,0)) X=$P(^(0),U);17"
N BICOL S BICOL=" # Lot Number Manufacturer"
D SEL^BISELECT(9999999.41,"BILOT","Lot Number",,,,BIID,BICOL,.BIPOP)
;
;
D:('$D(BILOT("ALL")))
.D TITLE^BIUTL5("FULL OR LIMITED HISTORY")
.D TEXT7
.S B=$S($D(BI):"Yes",1:"No")
.D DIR^BIFMAN("YAO",.Y,," Limit histories to selected lot numbers? (Yes/No): ",B)
.I 'Y K BIMMLF Q
.N N S N=0
.F S N=$O(BILOT(N)) Q:'N D
..N M S M=$$LOTTX^BIUTL6(N)
..S:M BIMMLF(M)=""
;
;
D @("RESET^"_BIRTN)
Q
;
;
;----------
PGROUP2(BIPG,BIRTN) ;EP
;---> Selecting Patient Group (instead of individually).
;---> Called by Protocol BI OUTPUT IMMUNIZATION DUE.
;---> Parameters:
; 1 - BIPG (ret) Patient Group.
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
;---> Select group of patients to be exported.
S:'$G(BIPG) BIPG=1
N DIR,X
D FULL^VALM1
D TITLE^BIUTL5("SELECT PATIENT GROUP"),TEXT1,HELP1
S X="SO^1:Active only;2:Active + Inactive"
S X=X_";3:All who have had an Immunization Visit"
S DIR(0)=X,DIR("B")=BIPG
D ^DIR
S:'$D(DIRUT) BIPG=+Y
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT1 ;EP
;;Please select a Patient Group from the following:
;;
;; 1) Only patients who were ACTIVE in the Immunization Register on
;; the Survey Date.
;;
;; 2) BOTH Active and Inactive patients in the Immunization Register.
;;
;; 3) ALL patients who have had an Immunization at the selected
;; facility(s), including those NOT in the Immunization Register.
;;
D PRINTX("TEXT1",3)
Q
;
;
;----------
HELP1 ;EP
;;
;;
;;Choose a number 1-3 that represents the group of Patients whose
;;data you wish to export.
;;
;;NOTE: This group will be subject to the other selections you make
;; regarding Age Range, Community, Health Care Facility, etc.
;;
D HELPTX("HELP1")
Q
;
;
;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
;---> Corrected spelling and setting of parameter BIMMRF below.
;----------
IMMRCV(BIMMR,BIRDT,BIMMRF,BIRTN) ;EP
;---> Select Immunizations Received.
;---> Called by Protocol BI OUTPUT IMMUNIZATION RECEIVED.
;---> Parameters:
; 1 - BIMMR (ret) Local array of Vaccine IENs.
; 2 - BIRDT (ret) Date Range for Imms received: BeginDate_":"_EndDate
; 3 - BIMMRF (ret) Local array of Vaccine IENs to be filtered.
; 4 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
;---> Select cases for one or more IMMUNIZATIONS RECEIVED (OR ALL).
N BICOL S BICOL=" # Vaccine Received HL7 Code"
D SEL^BISELECT(9999999.14,"BIMMR","Vaccine",,,2,"3;;24",BICOL,.BIPOP)
;
D:'$G(BIPOP)
.N BIBEGDT,BIENDDT,BIBEGDF,BIENDDF,X
.S X=$G(BIRDT) S BIBEGDF=$P(X,":"),BIENDDF=$P(X,":",2)
.S:'BIBEGDF BIBEGDF=2000101 S:'BIENDDF BIENDDF=$G(DT)
.D TITLE^BIUTL5("SELECT IMMUNIZATION RECEIVED DATE RANGE")
.D TEXT4
.;
.W !!," Do you wish to specify a date range for immunizations received?"
.N DIR S DIR("?")=" Enter YES to specify a date range; NO to ignore dates."
.S DIR(0)="Y",DIR("A")=" Enter Yes or No",DIR("B")="NO"
.D ^DIR W !
.I ($D(DIRUT)!'$G(Y)) S BIRDT="" Q
.;
.D TITLE^BIUTL5("SELECT IMMUNIZATION RECEIVED DATE RANGE")
.D TEXT5
.D ASKDATES^BIUTL3(.BIBEGDT,.BIENDDT,.BIPOP,BIBEGDF,BIENDDF)
.Q:$G(BIPOP)
.S:'BIBEGDT BIBEGDT=2000101 S:'BIENDDT BIENDDT=$G(DT)
.S BIRDT=BIBEGDT_":"_BIENDDT
;
D:('$D(BIMMR("ALL")))
.D TITLE^BIUTL5("FULL OR LIMITED HISTORY")
.D TEXT6
.S B=$S($D(BI):"Yes",1:"No")
.D DIR^BIFMAN("YAO",.Y,," Limit histories to selected vaccines? (Yes/No): ",B)
.I 'Y K BIMMRF S BIMMRF("ALL")="" Q
.K BIMMRF("ALL")
.N N S N=0
.F S N=$O(BIMMR(N)) Q:'N D
..S BIMMRF(N)=""
;**********
;
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT4 ;EP
;;You may limit this list to patients who have received the vaccines
;;you selected within a specific date range. This date range will
;;apply to your list, whether you have chosen just one vaccine or
;;several vaccines or all vaccines.
;;
;;NOTE: If you selected "ALL" vaccines and do NOT specify a date range,
;;then this filter becomes essentially inactive and will have no effect
;;on your list (patients will not be excluded on the basis of immunizations
;;received, even if they have never received any immunization).
;;
;;However, if you selected "ALL" vaccines and you DO specify a date range,
;;then only patients who have received AT LEAST ONE immunization during
;;your date range will be included. (Patients who did not receive ANY
;;immunizations during your date range will be excluded from the report.)
;;
D PRINTX("TEXT4")
Q
;
;
;----------
TEXT5 ;EP
;;By default, the date range is from 1/1/1900 to today (essentially
;;not limited by date). However, you can specify a different date
;;range below. Only patients who have received the specified vaccines
;;within the date range you select will be included in the list.
;;
D PRINTX("TEXT5")
Q
;
;
;----------
TEXT6 ;EP
;;You have limited your list to patients who have received one or more
;;of the specific vaccines you selected.
;;
;;If you print/export their immunization histories in a list, would you
;;like to include the history of ONLY the vaccines you selected?
;;
;;Or would you like to include the ENTIRE patient histories?
;;
;;NOTE: If you have limited your export to patients who have received
;;one or more vaccines WITHIN A DATE RANGE, but you also elect to include
;;their entire immunization histories, then some immunizations outside the
;;date range will most likely be included in the export.
;;
;;THIS IS NOT AN ERROR. It is merely a consequence of including the entire
;;histories of patients who have already been filtered for the specific
;;vaccine within the date range.
;;
D PRINTX("TEXT6")
Q
;
;
;----------
TEXT7 ;EP
;;You have limited your list to patients who have received one or more
;;specific lot numbers.
;;
;;If you print their immunization histories in a list, would you like
;;to display only the history of the lot numbers you selected?
;;
D PRINTX("TEXT7")
Q
;
;
;----------
IMMDUE(BIMMD,BIRTN) ;EP
;---> Select Immunizations Due.
;---> Called by Protocol BI OUTPUT IMMUNIZATION DUE.
;---> Parameters:
; 1 - BIMMD (ret) Local array of Vaccine IENs.
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
;---> Select cases for one or more IMMUNIZATIONS DUE (OR ALL).
N BICOL S BICOL=" # Vaccine Due HL7 Code"
D SEL^BISELECT(9999999.14,"BIMMD","Vaccine",,,2,"3;;19",BICOL,.BIPOP)
D @("RESET^"_BIRTN)
Q
;
;
HISTORC(BIHIST,BIRTN) ;EP
;---> Select whether to include Historical Visits.
;---> Called by Protocol BI OUTPUT HISTORICAL.
;---> Parameters:
; 1 - BIHIST (ret) Include Historical (1=yes,0=no).
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
D FULL^VALM1
D TITLE^BIUTL5("INCLUDE HISTORICAL VISITS"),TEXT2
N A,B,Y S:'$G(BIHIST) BIHIST=1
S A=" Include Historical Visits (Yes/No): "
S B=$S(BIHIST:"YES",1:"NO")
D DIR^BIFMAN("YA",.Y,,A,B)
S BIHIST=+Y
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT2 ;EP
;;Should Historical Visits be included in this report?
;;
;;"Historical" refers to the Category field of a Visit as displayed and
;;edited on the ADD/EDIT IMMUNIZATION Screen for Immunization Visits.
;;
;;A Visit may be given a Category of "Historical Event" rather than
;;"Ambulatory" or "Inpatient" for a variety of reasons, for example:
;;An immunization that was not administered at the current clinic but
;;merely added to the record for completeness might be "Historical".
;;Immunizations not intended to be picked up by Billing could be
;;given a Category of "Historical".
;;
;;Please select whether to include Historical Visits in this report.
;;
D PRINTX("TEXT2")
Q
;
;
U19(BIU19,BIRTN) ;EP
;---> Select whether to limit Elig Report to patients <19 yrs of age.
;---> Called by Protocol BI OUTPUT INCLUDE ADULTS.
;---> Parameters:
; 1 - BIU19 (ret) Include Adults (1=yes,0=no).
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
D FULL^VALM1
D TITLE^BIUTL5("INCLUDE ADULTS"),TEXT8
N A,B,Y S:($G(BIU19)="") BIU19=0
S A=" Include Adult visits (Yes/No): "
S B=$S(BIU19:"YES",1:"NO")
D DIR^BIFMAN("YA",.Y,,A,B)
S BIU19=+Y
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT8 ;EP
;;Should immunizations be included that were given when the patient
;;was 19 years of age or older?
;;
;;If you are primarily interested in a Vaccine For Children (VFC)
;;Eligibility report, then answer "No."
;;
;;If you are interested in an Eligibility report that covers adults
;;as well as children, then answer "Yes."
;;
D PRINTX("TEXT8")
Q
;
;
DELIM(BIDELIM,BIRTN) ;EP
;---> Select which Delimiter to use, "2 spaces" or "^".
;---> Called by Protocol BI OUTPUT DILIMITER.
;---> Parameters:
; 1 - BIDELIM (ret) Delimiter (1="^", 2="2 spaces").
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
D FULL^VALM1
D TITLE^BIUTL5("SELECT DELIMITER"),TEXT9
;
N DIR,Y
S DIR("A")=" Select 1 for ""caret ^"" or 2 for ""2 spaces"": "
S DIR("B")=$S($G(BIDELIM)=1:"caret",1:"2 spaces")
S DIR(0)="SAM^1:caret;2:2 spaces"
D ^DIR K DIR
D
.I Y=1 S BIDELIM=1 Q
.S BIDELIM=2
;
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT9 ;EP
;;This report displays six data fields of each immunizatioin in
;;six columns. They are:
;;
;;(1)Date 2)Last,First Name (3)DOB (4)Eligibility (5)Vaccine (6)Lot#
;;
;;In the display, these six fields will be separated from each other by
;;a "delimiter." The delimiter can be either a caret "^" or "2 spaces".
;;
;;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 PRINTX("TEXT9")
Q
;
;
DISBLOT(BIDLOT,BIRTN) ;EP
;---> Select whether to display VAC Report by Lot Number.
;---> Called by Protocol BI OUTPUT DISPLAY BY LOT NUMBER.
;---> Parameters:
; 1 - BIDLOT (req) Display by Lot Number (1=yes,0=no).
; 2 - BIRTN (req) Calling routine for reset.
;
I $G(BIRTN)="" D ERRCD^BIUTL2(621,,1) Q
;
D FULL^VALM1
D TITLE^BIUTL5("DISPLAY REPORT BY LOT NUMBERS"),TEXT3
N A,B,Y S:'$G(BIDLOT) BIDLOT=0
S A=" Display by Lot Numbers (Yes/No): "
S B=$S(BIDLOT:"YES",1:"NO")
D DIR^BIFMAN("YA",.Y,,A,B)
S BIDLOT=+Y
D @("RESET^"_BIRTN)
Q
;
;
;----------
TEXT3 ;EP
;;Should the vaccines in this report to be displayed by lot number?
;;
;;By default, this 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.
;;
;;Please select whether to display the report by Lot Numbers.
;;
D PRINTX("TEXT3")
Q
;
;
;----------
PRINTX(BILINL,BITAB) ;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'[";;" W !,T,$P(X,";;",2)
Q
;
;
;----------
HELPTX(BILINL,BITAB) ;EP
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 DIR("?",I)=T_$P(X,";;",2)
S DIR("?")=DIR("?",I-1) K DIR("?",I-1)
Q
BIOUTPT3 ;IHS/CMI/MWR - PROMPTS FOR REPORTS.; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;**9**;OCT 01,2014
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; PROMPTS FOR REPORT PARAMETERS.
+4 ;; PATCH 1: Clarify Date Range on Imms Received with added prompt. IMMRCV+20
+5 ;; PATCH 2: Add two more questions, U19 and DELIM.
+6 ;; PATCH 9: Corrected spelling and setting of parameter BIMMRF. IMMRCV+0
+7 ;
+8 ;
+9 ;----------
MINDAYS(BIMD,BIPOP) ;EP
+1 ;---> Select Minimum Number of days since last letter sent.
+2 ;---> Called by routine BIDUPLT.
+3 ;---> Parameters:
+4 ; 1 - BIMD (ret) Minimum Days since Last Letter.
+5 ; 2 - BIPOP (ret) BIPOP=1 if DTOUT or DUOUT
+6 ;
+7 DO FULL^VALM1
+8 DO TITLE^BIUTL5("SELECT MINIMUM DAYS SINCE LAST LETTER")
+9 WRITE !!?3,"Please specify the minimum number of days between a patient's"
+10 WRITE !?3,"previous letter and today's letter."
+11 WRITE !?3,"Type ""?"" (no quotes) for further explanation.",!!
+12 NEW DIR,DIRUT
DO HELP2
+13 SET DIR(0)="NOA^0:9999:0"
+14 SET DIR("A")=" Enter Number of Days: "
+15 SET DIR("B")=$$MINDAYS^BIUTL2(DUZ(2))
+16 DO FULL^VALM1
+17 DO ^DIR
+18 IF $DATA(DIRUT)
SET BIPOP=1
QUIT
+19 SET BIMD=+Y
IF BIMD<0
SET BIMD=$$MINDAYS^BIUTL2(DUZ(2))
+20 QUIT
+21 ;
+22 ;
+23 ;----------
HELP2 ;EP
+1 ;;The Minimum Days Since Last Letter is the least number of days that
+2 ;;must elapse--after a letter has been sent to a patient--before the
+3 ;;software will automatically send another letter to that same patient.
+4 ;;
+5 ;;For example, if a patient received a letter 2 weeks ago and
+6 ;;the Minimum Days Last Letter is 60 days, then this software will
+7 ;;not generate a new letter for that patient today, even if the patient
+8 ;;fits the other criteria you have selected for Age, Community,
+9 ;;Immunizations Due, etc.
+10 DO HELPTX("HELP2")
+11 QUIT
+12 ;
+13 ;
+14 ;----------
LOTNUM(BILOT,BIRTN) ;EP
+1 ;---> Select Lot Numbers.
+2 ;---> Called by Protocol BI OUTPUT LOT NUMBER.
+3 ;---> Parameters:
+4 ; 1 - BILOT (ret) Local array of Lot Number IENs.
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 ;---> Select cases for one or more LOT NUMBERS (OR ALL).
+10 NEW BIID
SET BIID="2;I $G(X) S:$D(^AUTTIMAN(X,0)) X=$P(^(0),U);17"
+11 NEW BICOL
SET BICOL=" # Lot Number Manufacturer"
+12 DO SEL^BISELECT(9999999.41,"BILOT","Lot Number",,,,BIID,BICOL,.BIPOP)
+13 ;
+14 ;
+15 IF ('$DATA(BILOT("ALL")))
Begin DoDot:1
+16 DO TITLE^BIUTL5("FULL OR LIMITED HISTORY")
+17 DO TEXT7
+18 SET B=$SELECT($DATA(BI):"Yes",1:"No")
+19 DO DIR^BIFMAN("YAO",.Y,," Limit histories to selected lot numbers? (Yes/No): ",B)
+20 IF 'Y
KILL BIMMLF
QUIT
+21 NEW N
SET N=0
+22 FOR
SET N=$ORDER(BILOT(N))
IF 'N
QUIT
Begin DoDot:2
+23 NEW M
SET M=$$LOTTX^BIUTL6(N)
+24 IF M
SET BIMMLF(M)=""
End DoDot:2
End DoDot:1
+25 ;
+26 ;
+27 DO @("RESET^"_BIRTN)
+28 QUIT
+29 ;
+30 ;
+31 ;----------
PGROUP2(BIPG,BIRTN) ;EP
+1 ;---> Selecting Patient Group (instead of individually).
+2 ;---> Called by Protocol BI OUTPUT IMMUNIZATION DUE.
+3 ;---> Parameters:
+4 ; 1 - BIPG (ret) Patient Group.
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 ;---> Select group of patients to be exported.
+10 IF '$GET(BIPG)
SET BIPG=1
+11 NEW DIR,X
+12 DO FULL^VALM1
+13 DO TITLE^BIUTL5("SELECT PATIENT GROUP")
DO TEXT1
DO HELP1
+14 SET X="SO^1:Active only;2:Active + Inactive"
+15 SET X=X_";3:All who have had an Immunization Visit"
+16 SET DIR(0)=X
SET DIR("B")=BIPG
+17 DO ^DIR
+18 IF '$DATA(DIRUT)
SET BIPG=+Y
+19 DO @("RESET^"_BIRTN)
+20 QUIT
+21 ;
+22 ;
+23 ;----------
TEXT1 ;EP
+1 ;;Please select a Patient Group from the following:
+2 ;;
+3 ;; 1) Only patients who were ACTIVE in the Immunization Register on
+4 ;; the Survey Date.
+5 ;;
+6 ;; 2) BOTH Active and Inactive patients in the Immunization Register.
+7 ;;
+8 ;; 3) ALL patients who have had an Immunization at the selected
+9 ;; facility(s), including those NOT in the Immunization Register.
+10 ;;
+11 DO PRINTX("TEXT1",3)
+12 QUIT
+13 ;
+14 ;
+15 ;----------
HELP1 ;EP
+1 ;;
+2 ;;
+3 ;;Choose a number 1-3 that represents the group of Patients whose
+4 ;;data you wish to export.
+5 ;;
+6 ;;NOTE: This group will be subject to the other selections you make
+7 ;; regarding Age Range, Community, Health Care Facility, etc.
+8 ;;
+9 DO HELPTX("HELP1")
+10 QUIT
+11 ;
+12 ;
+13 ;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
+14 ;---> Corrected spelling and setting of parameter BIMMRF below.
+15 ;----------
IMMRCV(BIMMR,BIRDT,BIMMRF,BIRTN) ;EP
+1 ;---> Select Immunizations Received.
+2 ;---> Called by Protocol BI OUTPUT IMMUNIZATION RECEIVED.
+3 ;---> Parameters:
+4 ; 1 - BIMMR (ret) Local array of Vaccine IENs.
+5 ; 2 - BIRDT (ret) Date Range for Imms received: BeginDate_":"_EndDate
+6 ; 3 - BIMMRF (ret) Local array of Vaccine IENs to be filtered.
+7 ; 4 - BIRTN (req) Calling routine for reset.
+8 ;
+9 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+10 ;
+11 ;---> Select cases for one or more IMMUNIZATIONS RECEIVED (OR ALL).
+12 NEW BICOL
SET BICOL=" # Vaccine Received HL7 Code"
+13 DO SEL^BISELECT(9999999.14,"BIMMR","Vaccine",,,2,"3;;24",BICOL,.BIPOP)
+14 ;
+15 IF '$GET(BIPOP)
Begin DoDot:1
+16 NEW BIBEGDT,BIENDDT,BIBEGDF,BIENDDF,X
+17 SET X=$GET(BIRDT)
SET BIBEGDF=$PIECE(X,":")
SET BIENDDF=$PIECE(X,":",2)
+18 IF 'BIBEGDF
SET BIBEGDF=2000101
IF 'BIENDDF
SET BIENDDF=$GET(DT)
+19 DO TITLE^BIUTL5("SELECT IMMUNIZATION RECEIVED DATE RANGE")
+20 DO TEXT4
+21 ;
+22 WRITE !!," Do you wish to specify a date range for immunizations received?"
+23 NEW DIR
SET DIR("?")=" Enter YES to specify a date range; NO to ignore dates."
+24 SET DIR(0)="Y"
SET DIR("A")=" Enter Yes or No"
SET DIR("B")="NO"
+25 DO ^DIR
WRITE !
+26 IF ($DATA(DIRUT)!'$GET(Y))
SET BIRDT=""
QUIT
+27 ;
+28 DO TITLE^BIUTL5("SELECT IMMUNIZATION RECEIVED DATE RANGE")
+29 DO TEXT5
+30 DO ASKDATES^BIUTL3(.BIBEGDT,.BIENDDT,.BIPOP,BIBEGDF,BIENDDF)
+31 IF $GET(BIPOP)
QUIT
+32 IF 'BIBEGDT
SET BIBEGDT=2000101
IF 'BIENDDT
SET BIENDDT=$GET(DT)
+33 SET BIRDT=BIBEGDT_":"_BIENDDT
End DoDot:1
+34 ;
+35 IF ('$DATA(BIMMR("ALL")))
Begin DoDot:1
+36 DO TITLE^BIUTL5("FULL OR LIMITED HISTORY")
+37 DO TEXT6
+38 SET B=$SELECT($DATA(BI):"Yes",1:"No")
+39 DO DIR^BIFMAN("YAO",.Y,," Limit histories to selected vaccines? (Yes/No): ",B)
+40 IF 'Y
KILL BIMMRF
SET BIMMRF("ALL")=""
QUIT
+41 KILL BIMMRF("ALL")
+42 NEW N
SET N=0
+43 FOR
SET N=$ORDER(BIMMR(N))
IF 'N
QUIT
Begin DoDot:2
+44 SET BIMMRF(N)=""
End DoDot:2
End DoDot:1
+45 ;**********
+46 ;
+47 DO @("RESET^"_BIRTN)
+48 QUIT
+49 ;
+50 ;
+51 ;----------
TEXT4 ;EP
+1 ;;You may limit this list to patients who have received the vaccines
+2 ;;you selected within a specific date range. This date range will
+3 ;;apply to your list, whether you have chosen just one vaccine or
+4 ;;several vaccines or all vaccines.
+5 ;;
+6 ;;NOTE: If you selected "ALL" vaccines and do NOT specify a date range,
+7 ;;then this filter becomes essentially inactive and will have no effect
+8 ;;on your list (patients will not be excluded on the basis of immunizations
+9 ;;received, even if they have never received any immunization).
+10 ;;
+11 ;;However, if you selected "ALL" vaccines and you DO specify a date range,
+12 ;;then only patients who have received AT LEAST ONE immunization during
+13 ;;your date range will be included. (Patients who did not receive ANY
+14 ;;immunizations during your date range will be excluded from the report.)
+15 ;;
+16 DO PRINTX("TEXT4")
+17 QUIT
+18 ;
+19 ;
+20 ;----------
TEXT5 ;EP
+1 ;;By default, the date range is from 1/1/1900 to today (essentially
+2 ;;not limited by date). However, you can specify a different date
+3 ;;range below. Only patients who have received the specified vaccines
+4 ;;within the date range you select will be included in the list.
+5 ;;
+6 DO PRINTX("TEXT5")
+7 QUIT
+8 ;
+9 ;
+10 ;----------
TEXT6 ;EP
+1 ;;You have limited your list to patients who have received one or more
+2 ;;of the specific vaccines you selected.
+3 ;;
+4 ;;If you print/export their immunization histories in a list, would you
+5 ;;like to include the history of ONLY the vaccines you selected?
+6 ;;
+7 ;;Or would you like to include the ENTIRE patient histories?
+8 ;;
+9 ;;NOTE: If you have limited your export to patients who have received
+10 ;;one or more vaccines WITHIN A DATE RANGE, but you also elect to include
+11 ;;their entire immunization histories, then some immunizations outside the
+12 ;;date range will most likely be included in the export.
+13 ;;
+14 ;;THIS IS NOT AN ERROR. It is merely a consequence of including the entire
+15 ;;histories of patients who have already been filtered for the specific
+16 ;;vaccine within the date range.
+17 ;;
+18 DO PRINTX("TEXT6")
+19 QUIT
+20 ;
+21 ;
+22 ;----------
TEXT7 ;EP
+1 ;;You have limited your list to patients who have received one or more
+2 ;;specific lot numbers.
+3 ;;
+4 ;;If you print their immunization histories in a list, would you like
+5 ;;to display only the history of the lot numbers you selected?
+6 ;;
+7 DO PRINTX("TEXT7")
+8 QUIT
+9 ;
+10 ;
+11 ;----------
IMMDUE(BIMMD,BIRTN) ;EP
+1 ;---> Select Immunizations Due.
+2 ;---> Called by Protocol BI OUTPUT IMMUNIZATION DUE.
+3 ;---> Parameters:
+4 ; 1 - BIMMD (ret) Local array of Vaccine IENs.
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 ;---> Select cases for one or more IMMUNIZATIONS DUE (OR ALL).
+10 NEW BICOL
SET BICOL=" # Vaccine Due HL7 Code"
+11 DO SEL^BISELECT(9999999.14,"BIMMD","Vaccine",,,2,"3;;19",BICOL,.BIPOP)
+12 DO @("RESET^"_BIRTN)
+13 QUIT
+14 ;
+15 ;
HISTORC(BIHIST,BIRTN) ;EP
+1 ;---> Select whether to include Historical Visits.
+2 ;---> Called by Protocol BI OUTPUT HISTORICAL.
+3 ;---> Parameters:
+4 ; 1 - BIHIST (ret) Include Historical (1=yes,0=no).
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 DO FULL^VALM1
+10 DO TITLE^BIUTL5("INCLUDE HISTORICAL VISITS")
DO TEXT2
+11 NEW A,B,Y
IF '$GET(BIHIST)
SET BIHIST=1
+12 SET A=" Include Historical Visits (Yes/No): "
+13 SET B=$SELECT(BIHIST:"YES",1:"NO")
+14 DO DIR^BIFMAN("YA",.Y,,A,B)
+15 SET BIHIST=+Y
+16 DO @("RESET^"_BIRTN)
+17 QUIT
+18 ;
+19 ;
+20 ;----------
TEXT2 ;EP
+1 ;;Should Historical Visits be included in this report?
+2 ;;
+3 ;;"Historical" refers to the Category field of a Visit as displayed and
+4 ;;edited on the ADD/EDIT IMMUNIZATION Screen for Immunization Visits.
+5 ;;
+6 ;;A Visit may be given a Category of "Historical Event" rather than
+7 ;;"Ambulatory" or "Inpatient" for a variety of reasons, for example:
+8 ;;An immunization that was not administered at the current clinic but
+9 ;;merely added to the record for completeness might be "Historical".
+10 ;;Immunizations not intended to be picked up by Billing could be
+11 ;;given a Category of "Historical".
+12 ;;
+13 ;;Please select whether to include Historical Visits in this report.
+14 ;;
+15 DO PRINTX("TEXT2")
+16 QUIT
+17 ;
+18 ;
U19(BIU19,BIRTN) ;EP
+1 ;---> Select whether to limit Elig Report to patients <19 yrs of age.
+2 ;---> Called by Protocol BI OUTPUT INCLUDE ADULTS.
+3 ;---> Parameters:
+4 ; 1 - BIU19 (ret) Include Adults (1=yes,0=no).
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 DO FULL^VALM1
+10 DO TITLE^BIUTL5("INCLUDE ADULTS")
DO TEXT8
+11 NEW A,B,Y
IF ($GET(BIU19)="")
SET BIU19=0
+12 SET A=" Include Adult visits (Yes/No): "
+13 SET B=$SELECT(BIU19:"YES",1:"NO")
+14 DO DIR^BIFMAN("YA",.Y,,A,B)
+15 SET BIU19=+Y
+16 DO @("RESET^"_BIRTN)
+17 QUIT
+18 ;
+19 ;
+20 ;----------
TEXT8 ;EP
+1 ;;Should immunizations be included that were given when the patient
+2 ;;was 19 years of age or older?
+3 ;;
+4 ;;If you are primarily interested in a Vaccine For Children (VFC)
+5 ;;Eligibility report, then answer "No."
+6 ;;
+7 ;;If you are interested in an Eligibility report that covers adults
+8 ;;as well as children, then answer "Yes."
+9 ;;
+10 DO PRINTX("TEXT8")
+11 QUIT
+12 ;
+13 ;
DELIM(BIDELIM,BIRTN) ;EP
+1 ;---> Select which Delimiter to use, "2 spaces" or "^".
+2 ;---> Called by Protocol BI OUTPUT DILIMITER.
+3 ;---> Parameters:
+4 ; 1 - BIDELIM (ret) Delimiter (1="^", 2="2 spaces").
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 DO FULL^VALM1
+10 DO TITLE^BIUTL5("SELECT DELIMITER")
DO TEXT9
+11 ;
+12 NEW DIR,Y
+13 SET DIR("A")=" Select 1 for ""caret ^"" or 2 for ""2 spaces"": "
+14 SET DIR("B")=$SELECT($GET(BIDELIM)=1:"caret",1:"2 spaces")
+15 SET DIR(0)="SAM^1:caret;2:2 spaces"
+16 DO ^DIR
KILL DIR
+17 Begin DoDot:1
+18 IF Y=1
SET BIDELIM=1
QUIT
+19 SET BIDELIM=2
End DoDot:1
+20 ;
+21 DO @("RESET^"_BIRTN)
+22 QUIT
+23 ;
+24 ;
+25 ;----------
TEXT9 ;EP
+1 ;;This report displays six data fields of each immunizatioin in
+2 ;;six columns. They are:
+3 ;;
+4 ;;(1)Date 2)Last,First Name (3)DOB (4)Eligibility (5)Vaccine (6)Lot#
+5 ;;
+6 ;;In the display, these six fields will be separated from each other by
+7 ;;a "delimiter." The delimiter can be either a caret "^" or "2 spaces".
+8 ;;
+9 ;;The default delimiter is "2 spaces". However, when the intention is
+10 ;;to print or copy the report to a text file for the purpose of importing
+11 ;;it into Excel or some other spreadsheet, use of the caret "^" is
+12 ;;preferable and recommended. (Spaces in the data itself might sometimes
+13 ;;be confused with spaces in the delimiter and/or spaces used to make the
+14 ;;columns line up.)
+15 ;;
+16 DO PRINTX("TEXT9")
+17 QUIT
+18 ;
+19 ;
DISBLOT(BIDLOT,BIRTN) ;EP
+1 ;---> Select whether to display VAC Report by Lot Number.
+2 ;---> Called by Protocol BI OUTPUT DISPLAY BY LOT NUMBER.
+3 ;---> Parameters:
+4 ; 1 - BIDLOT (req) Display by Lot Number (1=yes,0=no).
+5 ; 2 - BIRTN (req) Calling routine for reset.
+6 ;
+7 IF $GET(BIRTN)=""
DO ERRCD^BIUTL2(621,,1)
QUIT
+8 ;
+9 DO FULL^VALM1
+10 DO TITLE^BIUTL5("DISPLAY REPORT BY LOT NUMBERS")
DO TEXT3
+11 NEW A,B,Y
IF '$GET(BIDLOT)
SET BIDLOT=0
+12 SET A=" Display by Lot Numbers (Yes/No): "
+13 SET B=$SELECT(BIDLOT:"YES",1:"NO")
+14 DO DIR^BIFMAN("YA",.Y,,A,B)
+15 SET BIDLOT=+Y
+16 DO @("RESET^"_BIRTN)
+17 QUIT
+18 ;
+19 ;
+20 ;----------
TEXT3 ;EP
+1 ;;Should the vaccines in this report to be displayed by lot number?
+2 ;;
+3 ;;By default, this report lists the statistics by age for each vaccine.
+4 ;;However, you may elect to display the statistics for each separate
+5 ;;lot number under each vaccine. The totals for all lot numbers of
+6 ;;each vaccine will also be displayed.
+7 ;;
+8 ;;Please select whether to display the report by Lot Numbers.
+9 ;;
+10 DO PRINTX("TEXT3")
+11 QUIT
+12 ;
+13 ;
+14 ;----------
PRINTX(BILINL,BITAB) ;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
WRITE !,T,$PIECE(X,";;",2)
+4 QUIT
+5 ;
+6 ;
+7 ;----------
HELPTX(BILINL,BITAB) ;EP
+1 NEW I,T,X
SET T=""
IF '$DATA(BITAB)
SET BITAB=5
FOR I=1:1:BITAB
SET T=T_" "
+2 FOR I=1:1
SET X=$TEXT(@BILINL+I)
IF X'[";;"
QUIT
SET DIR("?",I)=T_$PIECE(X,";;",2)
+3 SET DIR("?")=DIR("?",I-1)
KILL DIR("?",I-1)
+4 QUIT