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

BUDCRPTE.m

Go to the documentation of this file.
  1. BUDCRPTE ; IHS/CMI/LAB - UDS REPORT PROCESSOR 03 Feb 2015 1:15 PM ; 23 Jan 2015 10:19 AM
  1. ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
  1. ;
  1. ;
  1. PROC ;EP - called from xbdbque
  1. S BUDJ=$J,BUDH=$H
  1. K ^TMP($J)
  1. S ^XTMP("BUDCRPT1",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"UDS REPORT"
  1. S ^XTMP("BUDCRP6B",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^UDS TABLE 6B LISTS"
  1. S ^XTMP("BUDCRP7",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^BUD TABLE 7 LISTS"
  1. S ^XTMP("BUDARP9DEL",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^BUD TABLE 9 DELIMINTED FILE"
  1. ;TABLE 3A
  1. K BUDTOT F X=1:1:39 S $P(BUDTOT("M"),U,X)=0,$P(BUDTOT("F"),U,X)=0,$P(BUDTOT("ALL"),U,X)=0,BUDTOT("U")=0 ;3A
  1. S BUD019("M")="",BUD019("F")="",BUD019("ALL")=""
  1. ;TABLE 5
  1. F X=1:1:6 S BUDTAB5(X)="0^0"
  1. F X=7:1:38 S BUDTAB5(X)="0^0"
  1. F X="9A","9B","20A","20A1","20A2","20B","20C","22A","22B","22C","22D","29A","10A","27a","27b","30A","30B","30C" S BUDTAB5(X)="0^0"
  1. ;TABLE 3B
  1. K BUDRACET
  1. ;S BUDRACET(LINE)=LINE NUMBER^LABEL^HISP/LATINO^NOT HISPANIC^UNREP^TOTAL^LINE LABEL 2^LINE LABEL 3"
  1. S BUDRACET(1)="1.^Asian^0^0^0^0"
  1. S BUDRACET("2A")="2a.^Native Hawaiian^0^0^0^0"
  1. S BUDRACET("2B")="2b.^Other Pacific^0^0^0^0^Islander"
  1. S BUDRACET(2)="2.^Total Hawaiian/^0^0^0^0^Pacific Islander^(Sum Lines 2a+2b)"
  1. S BUDRACET(3)="3.^Black/African^0^0^0^0^American"
  1. S BUDRACET(4)="4.^American Indian/^0^0^0^0^Alaska Native"
  1. S BUDRACET(5)="5.^White^0^0^0^0"
  1. S BUDRACET(6)="6.^More than one^0^0^0^0^race"
  1. S BUDRACET(7)="7.^Unreported/^0^0^0^0^Refused to Report"
  1. S BUDRACET(8)="8.^Total Patients^0^0^0^0^(Sum Lines 1+2^+ 3 to 7)"
  1. K BUDLANG
  1. S BUDLANG(12)="12.^Patients Best Served in a Language Other Than^0^English"
  1. ;TABLE 6
  1. F X=1:1:26 S $P(BUDT6("V"),U,X)=0,$P(BUDT6("P"),U,X)=0
  1. ;TABLE 4
  1. K BUDT4V
  1. F X=1:1:6 S BUDT4V(X)=0
  1. F X=7,"8a","8b",8,9,"9a","10a","10b",10,11,12 S BUDT4V(X)="0^0"
  1. F X=14:1:26 S BUDT4V(X)=0
  1. ;TABLE 9 DELIMITED
  1. S BUDT9C=0
  1. ;TABLE 9D
  1. K BUDT9TC
  1. F X=1,"2a","2b",3,4,"5a","5b",6,7,"8a","8b",9,10,"11a","11b",12,13,14 S BUDT9(X)="0^0" ;COLUMN A & B
  1. Q
  1. PT ;EP
  1. S (BUDROT,BUDDELT,BUDDELF)=""
  1. W !!,"Please choose an output type. For an explanation of the delimited",!,"file please see the user manual.",!
  1. S DIR(0)="S^P:Print Report on Printer or Screen;D:Create Delimited output file (for use in Excel)",DIR("A")="Select an Output Option",DIR("B")="P" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) Q
  1. S BUDROT=Y
  1. Q:BUDROT="P"
  1. S BUDDELF="",BUDDELT=""
  1. W !!,"You have selected to create a delimited output file. You can have this",!,"output file created as a text file in the pub directory, ",!,"OR you can have the delimited output display on your screen so that"
  1. W !,"you can do a file capture. Keep in mind that if you choose to",!,"do a screen capture you CANNOT Queue your report to run in the background!!",!!
  1. S DIR(0)="S^S:SCREEN - delimited output will display on screen for capture;F:FILE - delimited output will be written to an output file",DIR("A")="Select output type",DIR("B")="S" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G PT
  1. S BUDDELT=Y
  1. Q:BUDDELT="S"
  1. PT1 S DIR(0)="F^1:40",DIR("A")="Enter a filename for the delimited output (no more than 40 characters)" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G PT
  1. I Y["/" W !!!,"Your filename cannot contain a '/'." H 2 G PT1
  1. S BUDDELF=Y
  1. W !!,"When the report is finished your delimited output will be found in the",!,$$GETDEDIR()," directory."
  1. Q
  1. GETDEDIR() ;EP - get default directory
  1. NEW D
  1. S D=""
  1. S D=$P($G(^AUTTSITE(1,1)),"^",2)
  1. I D]"" Q D
  1. S D=$P($G(^XTV(8989.3,1,"DEV")),"^",1)
  1. I D]"" Q D
  1. I $P(^AUTTSITE(1,0),U,21)=1 S D="/usr/spool/uucppublic/"
  1. Q D