Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BIEXP2

BIEXP2.m

Go to the documentation of this file.
  1. BIEXP2 ;IHS/CMI/MWR - EXPORT IMMUNIZATION RECORDS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; EXPORT IMMUNIZATION RECORDS: SELECT PATIENTS BY GROUP.
  1. ;
  1. ;
  1. ;----------
  1. START ;EP
  1. ;---> Listman Screen for selecting Export Parameters, by Group.
  1. ;
  1. D SETVARS^BIUTL5
  1. ;---> Main entry point for Export by Individual Patients.
  1. D EN^VALM("BI EXPORT BY GROUP")
  1. D EXIT
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INIT ;EP
  1. ;---> Initialize variables and list array.
  1. ;
  1. S VALM("TITLE")=$$LMVER^BILOGO
  1. S VALMSG="Select a left column number to change an item."
  1. N BILINE,X S BILINE=0
  1. D WRITE(.BILINE)
  1. S X=IOUON_"EXPORT DATA BY GROUP" D CENTERT^BIUTL5(.X,42)
  1. D WRITE(.BILINE,X_IOINORM,1)
  1. K X
  1. ;
  1. ;---> Survey Date.
  1. S:'$G(BISVDT) BISVDT=DT
  1. S X=" 1 - Survey Date..............: "_$$TXDT1^BIUTL5(BISVDT)
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;---> Age Range.
  1. S:$G(BIAG)="" BIAG="1-72"
  1. N BIAG1
  1. D
  1. .I BIAG="ALL" S BIAG1="All Ages" Q
  1. .S BIAG1=$$MTHYR^BIAGE(BIAG)
  1. S X=" 2 - Age Range................: "_BIAG1
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;
  1. ;---> Patient Group.
  1. S:('$G(BIPG)!($G(BIPG)=9)) BIPG=1 N X
  1. D
  1. .I BIPG=1 S X="ACTIVE in the Register." Q
  1. .I BIPG=2 S X="BOTH Active and Inactive." Q
  1. .I BIPG=3 S X="ALL who have had an Immunization." Q
  1. .I BIPG=4 S X="ALL who have had a Visit of any kind." Q
  1. .I BIPG=5 S X="ALL Patients (including those w/o a Visit)." Q
  1. .S X="Make a selection." Q
  1. S X=" 3 - Patient Group............: "_X
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;---> Health Care Facility.
  1. N BIHCF1 S BIHCF1=""
  1. D
  1. .S:'$D(BIHCF) BIHCF("ALL")=""
  1. .I $D(BIHCF("ALL")) S BIHCF1="ALL" Q
  1. .N I,M,N
  1. .S N=0
  1. .F I=0:1 S N=$O(BIHCF(N)) Q:'N S M=N
  1. .I I=1 S BIHCF1=$$INSTTX^BIUTL6(M) Q
  1. .S BIHCF1="List (Select ""4"" to review list.)"
  1. S X=" 4 - Health Care Facility.....: "_BIHCF1
  1. D WRITE(.BILINE,X)
  1. K X
  1. ;
  1. ;---> Current Community.
  1. N BICC1 S BICC1=""
  1. D
  1. .S:'$D(BICC) BICC("ALL")=""
  1. .I $D(BICC("ALL")) S BICC1="ALL" Q
  1. .N I,M,N
  1. .S N=0
  1. .F I=0:1 S N=$O(BICC(N)) Q:'N S M=N
  1. .I I=1 S BICC1=$$CCTX^BIUTL6(M) Q
  1. .S BICC1="List (Select ""5"" to review list.)"
  1. S X=" 5 - Community................: "_BICC1
  1. D WRITE(.BILINE,X)
  1. K X
  1. ;
  1. ;---> Immunizations Received.
  1. N BIMMR1 S BIMMR1=""
  1. D
  1. .S:'$D(BIMMR) BIMMR("ALL")=""
  1. .I $D(BIMMR("ALL")) S BIMMR1="ALL" Q
  1. .N I,M,N
  1. .S N=0
  1. .F I=0:1 S N=$O(BIMMR(N)) Q:'N S M=N
  1. .I I=1 S BIMMR1=$$VNAME^BIUTL2(M) Q
  1. .S BIMMR1="List (Select ""6"" to review list.)"
  1. S X=" 6 - Immunizations Received...: "_BIMMR1
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;---> Data Elements.
  1. N BIDE1 S BIDE1=""
  1. D
  1. .I '$D(BIDE) S BIDE1="None" Q
  1. .I $D(BIDE("ALL")) S BIDE1="ALL" Q
  1. .N I,M,N
  1. .S N=0
  1. .F I=0:1 S N=$O(BIDE(N)) Q:'N S M=N
  1. .I I=1 S BIDE1=$$DETX^BIUTL6(M) Q
  1. .S BIDE1="List (Select ""7"" to review list.)"
  1. S X=" 7 - Data Elements............: "_BIDE1
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;---> File Format (1=ASCII,2=HL7,3=ImmServe).
  1. S:'$G(BIFMT) BIFMT=1
  1. N BIFMT1
  1. S BIFMT1=$S(BIFMT=2:"HL7",BIFMT=3:"ImmServe",1:"ASCII")
  1. S X=" 8 - File Format..............: "_BIFMT1
  1. D WRITE(.BILINE,X,1)
  1. K X
  1. ;
  1. ;---> Output.
  1. D
  1. .I '$G(BIOUT) S BIOUT=0,BIFLNM="" Q
  1. .I $G(BIFLNM)="" S BIOUT=0
  1. N BIOUT1
  1. S BIOUT1=$S(BIOUT:"File: "_$G(BIPATH)_BIFLNM,1:"SCREEN")
  1. S X=" 9 - Output Device............: "_BIOUT1
  1. D WRITE(.BILINE,X)
  1. K X
  1. ;
  1. ;---> Finish up Listmanager List Count.
  1. S VALMCNT=BILINE
  1. S BIRTN="BIEXP2"
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. WRITE(BILINE,BIVAL,BIBLNK) ;EP
  1. ;---> Write lines to ^TMP (see documentation in ^BIW).
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Last line# written.
  1. ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
  1. ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
  1. ;
  1. Q:'$D(BILINE)
  1. D WL^BIW(.BILINE,"BIEXP2",$G(BIVAL),$G(BIBLNK))
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. RESET ;EP
  1. ;---> Update partition for return to Listmanager.
  1. I $D(VALMQUIT) S VALMBCK="Q" Q
  1. D TERM^VALM0 S VALMBCK="R"
  1. D INIT Q
  1. ;
  1. ;
  1. ;----------
  1. HELP ;EP
  1. ;---> Help code.
  1. D FULL^VALM1 N BIPOP
  1. D TITLE^BIUTL5("EXPORT DATA BY GROUP - HELP, page 1 of 2")
  1. D TEXT1,DIRZ^BIUTL3(.BIPOP)
  1. I $G(BIPOP) D RESET Q
  1. D TITLE^BIUTL5("EXPORT DATA BY GROUP - HELP, page 2 of 2")
  1. D TEXT2,DIRZ^BIUTL3()
  1. D RESET
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT1 ;
  1. ;;The EXPORT DATA BY GROUP screen provides a menu of options for
  1. ;;exporting the data of groups of patients.
  1. ;;
  1. ;;There are 8 items or "parameters" on the screen that you may
  1. ;;change in order to specify which patients and which data will be
  1. ;;exported, as well as the output device for the export.
  1. ;;
  1. ;;To change an item, enter its left column number (1-8) at the
  1. ;;prompt on the bottom of the screen. Use "?" at any prompt where
  1. ;;you would like help or more information on the parameter you are
  1. ;;changing.
  1. ;;
  1. ;;Once you have the parameters set to retrieve the patients and data
  1. ;;you want, select E to Export the data.
  1. ;;
  1. D PRINTX("TEXT1")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT2 ;EP
  1. ;;COMMUNITIES: If you select for specific Communities, only patients
  1. ;;whose Current Community (under Patient Registration) is one of the
  1. ;;selected Communities will be included in the export.
  1. ;;
  1. ;;HEALTH CARE FACILITIES: If you select for specific Health Care
  1. ;;Facilities, only patients who have had AT LEAST ONE immunization
  1. ;;at one of the selected Health Care Facilities will be included in
  1. ;;the export.
  1. ;;
  1. ;;VACCINES: If you select for specific Vaccines, only immunizations
  1. ;;given with the selected vaccines will be included in the export.
  1. ;;
  1. ;;DATE ELEMENTS: Select the group of Data Elements you wish to export
  1. ;;for each immunization.
  1. ;;
  1. ;;SURVEY DATE, PATIENT GROUP, FILE FORMAT and OUTPUT DEVICE:
  1. ;;Detailed help will be given when you select these items.
  1. D PRINTX("TEXT2")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. PRINTX(BILINL,BITAB) ;EP
  1. Q:$G(BILINL)=""
  1. N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
  1. F I=1:1 S X=$T(@BILINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EXIT ;EP
  1. ;---> EOJ cleanup.
  1. K ^TMP("BIEXP2",$J)
  1. D CLEAR^VALM1
  1. D FULL^VALM1
  1. Q