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

BIEXP.m

Go to the documentation of this file.
  1. BIEXP ;IHS/CMI/MWR - EXPORT IMMUNIZATION RECORDS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;**9**;OCT 01,2014
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; EXPORT IMMUNIZATION RECORDS: MAIN DRIVER.
  1. ;; PATCH 9: Changes to include Default Volume and Component fields in
  1. ;; Vaccine Table export. EXPVT+14
  1. ;
  1. ;
  1. ;----------
  1. START ;EP
  1. ;---> Export Immunization Data.
  1. ;
  1. D SETVARS^BIUTL5 N BIRTN
  1. ;
  1. ;---> Introduction.
  1. N BIPOP S BIPOP=0
  1. S BITL="EXPORT IMMUNIZATION RECORDS"
  1. D TITLE^BIUTL5(BITL),TEXT1
  1. D DIRZ^BIUTL3(.BIPOP)
  1. Q:BIPOP
  1. ;
  1. ;
  1. F D Q:BIPOP
  1. .;---> Choose to select either individually or by group.
  1. .N A,X,Y
  1. .D TITLE^BIUTL5(BITL),TEXT2
  1. .S A=" Enter either 1 or 2: "
  1. .S X="SOAB^1:Individually;2:Group"
  1. .D DIR^BIFMAN(X,.Y,.BIPOP,A)
  1. .Q:BIPOP
  1. .;
  1. .;---> Select Patients individually and export data.
  1. .I Y=1 D ^BIEXP1 Q
  1. .;---> Select Patients by group and export data.
  1. .D ^BIEXP2
  1. ;
  1. D EXIT
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT1 ;EP
  1. ;;
  1. ;;This program will allow you to select a group of patients and to
  1. ;;export their demographic and immunization data either to a file
  1. ;;or to your screen (for capture by a PC).
  1. ;;
  1. ;;You will have the opportunity to either select individual patients
  1. ;;(by Name or Chart#), or to select a group of patients by specifying
  1. ;;Status in the Register, Visit History, Age Range, Facility, and
  1. ;;Current Community. You will also be able to limit the export data
  1. ;;to specific Vaccines.
  1. ;;
  1. ;;Lastly, you will be given the option of exporting the data in
  1. ;;either an ASCII text format or Immserve data format.
  1. ;;
  1. D PRINTX("TEXT1")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT2 ;EP
  1. ;;
  1. ;;Do you wish to:
  1. ;;
  1. ;; 1) Select patients INDIVIDUALLY by entering their Names
  1. ;; or Chart Numbers,
  1. ;;or
  1. ;; 2) Select patients by GROUP, specifying Age Range, Status,
  1. ;; Current Community, etc.
  1. ;;
  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("BIEXP1",$J),^TMP("BIEXP2",$J)
  1. D KILLALL^BIUTL8(1)
  1. D CLEAR^VALM1
  1. D FULL^VALM1
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EXPVT ;EP
  1. ;---> Export Vaccine Table to a CVS (Excel compatible) host file.
  1. D SETVARS^BIUTL5
  1. N BIFLNM,BIPATH,BIPOP
  1. S BIFLNM="RPMS Vaccine Table.csv"
  1. D HFS^BIEXPRT8(BIFLNM,.BIPATH,1,.BIPOP)
  1. I $G(BIPOP) D ^%ZISC W !!?3,"Failure to open Host File." D DIRZ^BIUTL3() Q
  1. ;
  1. ;---> Host file is open.
  1. ;---> Use "," for CSV delimiter.
  1. N Q,D S Q="""",D=Q_","_Q
  1. ;
  1. ;---> Write Header row.
  1. W Q_"CVX Code"_D_"Name"_D_"Short Name"_D_"Vaccine Group"_D_"VIS Date"_D_"Active"
  1. ;
  1. ;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
  1. ;---> Include Default Volume and Component fields.
  1. W D_"Default Volume"
  1. W D_"Related Contra CVX's"_D_"1st Brand Name"_D_"2nd Brand Name"
  1. W D_"Component 1"_D_"Comp1 CVX"_D_"Component 2"_D_"Comp2 CVX"
  1. W D_"Component 3"_D_"Comp3 CVX"_D_"Component 4"_D_"Comp4 CVX"
  1. W D_"Component 5"_D_"Comp5 CVX"_D_"Component 6"_D_"Comp6 CVX"
  1. W D_"Long Name"_Q
  1. ;
  1. ;---> Write data records.
  1. N N S N=0
  1. F S N=$O(^BITN(N)) Q:'N D
  1. .N Y,Z S Y=^BITN(N,0),Z=$G(^BITN(N,1))
  1. .W !,Q_$P(Y,U,3)_D_$P(Y,U,1)_D_$P(Y,U,2)_D_$$VGROUP^BIUTL2($P(Y,U,9))
  1. .W D_$$SLDT1^BIUTL5($P(Y,U,13))_D_$S($P(Y,U,7)=1:"Inactive",1:"Active")
  1. .;
  1. .;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
  1. .;---> Include Default Volume and Component Fields.
  1. .W D_$P(Y,U,18)
  1. .W D_$P(Y,U,12)_D_$P(Z,U,1)_D_$P(Z,U,3)
  1. .N I F I=21:1:26 D
  1. ..I '$P(Y,U,I) W D_D Q
  1. ..W D_$$VNAME^BIUTL2($P(Y,U,I))_D_$$CODE^BIUTL2($P(Y,U,I))
  1. .;**********
  1. .W D_$P(Z,U,14)_Q
  1. ;
  1. ;---> Close the host file and report its location.
  1. D ^%ZISC
  1. D TITLE^BIUTL5("EXPORT VACCINE TABLE TO EXCEL FILE")
  1. W !!?5,"The Vaccine Table has been exported to:"
  1. W !!?10,BIPATH_BIFLNM
  1. D TEXT3
  1. D DIRZ^BIUTL3()
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT3 ;EP
  1. ;;
  1. ;;
  1. ;;
  1. ;;Note that the path ("folder" or "directory") in which the file
  1. ;;was placed is taken from the Immunization Site Parameter #6.
  1. ;;You can change that to a different location by editing the site
  1. ;;parameter (IMM-->MGR-->ESP-->6).
  1. ;;
  1. ;
  1. D PRINTX("TEXT3")
  1. Q