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

BUDBRPT1.m

Go to the documentation of this file.
  1. BUDBRPT1 ; IHS/CMI/LAB - UDS REPORT DRIVER 12 Dec 2014 8:11 AM 06 Oct 2014 1:48 PM ; 21 Nov 2014 10:44 AM
  1. ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
  1. ;
  1. ;
  1. Q ;not at top
  1. ;
  1. EN ;EP
  1. EN1 ;
  1. I $G(BUDT6B) W !,"Table 6B:" D PRENATT^BUDBRP6B
  1. I $G(BUDT7) W !,"Table 7:" D PRENATT^BUDBRP7
  1. ;I $G(BUDT6B)!($G(BUDT7)) D PNC I BUDPREN="" D EOJ Q
  1. S BUDSITE=""
  1. S DIC="^BUDBSITE(",DIC(0)="AEMQ",DIC("A")="Enter your site: " D ^DIC
  1. I Y=-1 D EOJ Q
  1. S BUDSITE=+Y
  1. I '$O(^BUDBSITE(BUDSITE,11,0)) W !!,"Warning: There are no locations defined in the site parameter file for this",!,"site. Report will not be accurate!" G EN
  1. S Q=0
  1. S BUDDIR=$$GETDIR()
  1. I $G(BUDT9)!($G(BUDT9D)) D I Q D EOJ Q
  1. .Q:DUZ(2)=BUDSITE
  1. .W !!,"WARNING: You selected a site that is different from the site you are"
  1. .W !,"logged in as and you selected to run Table 9 or Table 9 (Delimited). In"
  1. .W !,"order to get the appropriate data for these 2 tables you must be logged"
  1. .W !,"into RPMS as the same site as you selected as your UDS Site. If you"
  1. .W !,"want to run Tables 9 or 9 (Delimited) for ",$P(^DIC(4,BUDSITE,0),U,1)
  1. .W !,"you must log out and log back into RPMS selecting Division"
  1. .W !,$P(^DIC(4,BUDSITE,0),U,1),"."
  1. .D PAUSE^BUDBRP7
  1. .S Q=1
  1. S Q=""
  1. I $G(BUDT4) D I Q D EOJ Q
  1. .S S=$$VAL^XBDIQ1(9999999.06,BUDSITE,.16)
  1. .I S="" W !!,"SORRY, but I can't tell what state your clinic is located in" D
  1. ..W !,"so I can't run table 4's income section. Please ask your site manager"
  1. ..W !,"to put a state in the LOCATION file, field .16."
  1. ..D PAUSE^BUDBRP7
  1. ..S Q=1
  1. D TAXCHK^BUDBXTCH
  1. Y D YEAR
  1. I BUDYEAR="" W !!,"Year not entered.",! D EOJ Q
  1. D QUARTER ;get time period
  1. I BUDQTR="" W !,"Time period not entered." D EOJ Q
  1. ;get indian or not
  1. S BUDBEN=""
  1. S DIR(0)="S^1:Indian/Alaskan Native (Classification 01);2:Not Indian Alaskan/Native (Not Classification 01);3:All (both Indian/Alaskan Natives and Non 01)",DIR("A")="Select Beneficiary Population to include in this report"
  1. S DIR("B")="1" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G Y
  1. S BUDBEN=Y
  1. I $G(BUDT9D) D DELF I BUDFILE="" D EOJ Q
  1. ZIS ;call to XBDBQUE
  1. K IOP,%ZIS
  1. W !! S %ZIS="PQM" D ^%ZIS
  1. I POP D EOJ Q
  1. ZIS1 ;
  1. I $D(IO("Q")) G TSKMN
  1. DRIVER ;
  1. D PROC^BUDBRPTC
  1. U IO
  1. D PRINT^BUDBRPTP
  1. D ^%ZISC
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. D EOJ
  1. Q
  1. TSKMN ;EP ENTRY POINT FROM TASKMAN
  1. S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
  1. I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
  1. I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
  1. K ZTSAVE S ZTSAVE("BUD*")=""
  1. S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^BUDBRPT1",ZTDTH="",ZTDESC="UDS 14 REPORT" D ^%ZTLOAD D EOJ Q
  1. Q
  1. M ;EP - called from option
  1. D EOJ
  1. S BUDXXXXX=1
  1. D GENI
  1. K BUDT3A,BUDT3B,BUDT4,BUDT5,BUDT6,BUDTZ,BUDT5L1,BUDT6B,BUDT7
  1. W !!,"UDS Table Selection"
  1. W !!?5,"1 Patient Zip Code and Insurance Source"
  1. W !?5,"2 Table 3A: Patients by Age and Gender"
  1. W !?5,"3 Table 3B: Patients by Hispanic or Latino Identity/Race/Language"
  1. W !?5,"4 Table 4: Selected Patient Characteristics"
  1. W !?5,"5 Table 5 (a): Staffing List only (column A)"
  1. W !?5,"6 Table 5 (b&c): Staffing and Utilization (cols b&c)"
  1. W !?5,"7 Table 6A: Selected Diagnoses and Services Rendered"
  1. W !?5,"8 Table 6B: Quality of Care Indicators"
  1. W !?5,"9 Table 7: Health Outcomes and Disparities"
  1. W !?5,"10 Table 9D: Patient-Related Revenue (Total Counts Only)"
  1. W !?5,"11 Table 9D: Patient-Related Revenue (Delimited Report)"
  1. W !?5,"12 Multiple/ALL Tables Zip through 9D"
  1. S DIR(0)="L^1:12",DIR("A")="Include which Tables",DIR("B")=1 KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) D EOJ Q
  1. F X=1:1 S Z=$P(Y,",",X) Q:Z="" D
  1. .I Z=12 S (BUDT3A,BUDT3B,BUDT4,BUDT5,BUDT6,BUDTZ,BUDT5L1,BUDT6B,BUDT7,BUDT9,BUDT9D)=1
  1. .I Z=2 S BUDT3A=1
  1. .I Z=3 S BUDT3B=1
  1. .I Z=4 S BUDT4=1
  1. .I Z=5 S BUDT5=1,BUDT5L1=1
  1. .I Z=6 S BUDT5=1
  1. .I Z=7 S BUDT6=1
  1. .I Z=1 S BUDTZ=1
  1. .I Z=8 S BUDT6B=1
  1. .I Z=9 S BUDT7=1
  1. .I Z=10 S BUDT9=1
  1. .I Z=11 S BUDT9D=1
  1. G EN1
  1. ;
  1. PNC ;
  1. S BUDPREN=""
  1. S DIR(0)="Y",DIR("A")="Does your facility provide prenatal care",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) Q
  1. S BUDPREN=Y
  1. Q
  1. T3A ;EP - entry point for Table 3A only
  1. D EOJ
  1. S BUDT3A=1
  1. D GENI
  1. D T3AI
  1. G EN1
  1. ;
  1. T4 ;EP - entry point for Table 3A only
  1. D EOJ
  1. S BUDT4=1
  1. D GENI
  1. D T4I
  1. G EN1
  1. TZ ;EP - entry point for Table zip only
  1. D EOJ
  1. S BUDTZ=1
  1. D GENI
  1. D TZAI
  1. G EN1
  1. TZAI ;intro for table Z
  1. W !!,"Patients by Zip Code and Insurance Source"
  1. W !,"The Patient Zip Code by Insurance Source table reports the number of patients"
  1. W !,"by their zip code as entered in patient registration and their insurance source."
  1. Q
  1. T3AI ;intro for table 3A
  1. W !!,"TABLE 3A: USERS BY AGE AND GENDER"
  1. W !,"This report will produce UDS Table 3A, an itemization of users (patients) by age"
  1. W !,"and gender. Users must have at least one visit during the selected time period."
  1. W !,"as defined above. Age is calculated as of June 30th of the year you select.",!
  1. Q
  1. T4I ;intro for table 4
  1. W !!,"TABLE 4: SELECTED PATIENT CHARACTERISTICS"
  1. W !,"This report will produce UDS Table 4, selected patient characteristics."
  1. W !,"Patients must meet additional criteria as specified for each indicator.",!
  1. Q
  1. T3B ;EP
  1. D EOJ
  1. S BUDT3B=1
  1. D GENI
  1. D T3BI
  1. G EN1
  1. T3BI ;
  1. W !!,"TABLE 3B: USERS BY HISPANIC OR LATINO IDENTITY/RACE/LANGUAGE"
  1. W !,"This report will produce UDS Table 3B, an itemization of users",!,"by Hispanic or Latino Identity/Race/Language."
  1. Q
  1. T5 ;EP
  1. D EOJ
  1. S BUDT5=1
  1. D GENI
  1. D T5I
  1. G EN1
  1. T5I ;
  1. W !!,"TABLE 5 (b&c): STAFFING AND UTILIZATION"
  1. W !,"This report will produce UDS Table 5 that itemizes visits and patients",!,"(columns b and c only) by primary provider discipline."
  1. Q
  1. T51 ;EP
  1. D EOJ
  1. S BUDT5=1,BUDT5L1=1
  1. D GENI
  1. D T51I
  1. G EN1
  1. T51I ;
  1. W !!,"STAFF LIST FOR TABLE 5 col a: STAFFING"
  1. W !,"This report will produce a Staff List to be used to manually calculate",!,"Column A on Table 5 Staffing and Utilization, itemizing all staff by"
  1. W !,"disciplines and by FTE."
  1. Q
  1. T6 ;EP - entry point for Table 6A only
  1. D EOJ
  1. S BUDT6=1
  1. D GENI
  1. D T6I
  1. G EN1
  1. T6I ;intro for table 6
  1. W !!,"TABLE 6A: SELECTED DIAGNOSES AND SERVICES RENDERED"
  1. W !,"This report will produce UDS Table 6A which itemizes visits",!,"and patients by selected diagnoses and services provided.",!
  1. Q
  1. ;
  1. T9D ;EP
  1. D EOJ
  1. S BUDT9D=1
  1. D GENI
  1. S BUDDIR=$$GETDIR()
  1. D T9DI
  1. G EN1
  1. T9DI ;
  1. W !!,"TABLE 9D: Patient-Related Revenue (Delimited Report)"
  1. W !,"This is a delimited report, which will can be used to produce UDS Table 9D,"
  1. W !,"Patient-Related Revenue. Table 9D collects information on charges, "
  1. W !,"collections, retroactive settlements, allowances, self-pay sliding "
  1. W !,"discounts, and self-pay bad debt write-off."
  1. W !!,"NOTE: This delimited file will include only A/R Transactions for patients"
  1. W !,"who are considered 'UDS' patients (i.e. they are included in Table 3A)"
  1. W !!,"NOTE: You will be required to enter a name for the delimited output file."
  1. W !,"This file will be placed in the following directory:"
  1. W !?10,BUDDIR,!
  1. Q
  1. ;
  1. T9 ;EP
  1. D EOJ
  1. S BUDT9=1
  1. D GENI
  1. D T9I
  1. G EN1
  1. T9I ;
  1. W !!,"TABLE 9D: Patient-Related Revenue (Total Counts Only)"
  1. W !,"This report will produce UDS Table 9D, Patient-Related Revenue. This table "
  1. W !,"collects information on charges, collections, retroactive settlements, "
  1. W !,"allowances, self-pay sliding discounts, and self-pay bad debt write-off. "
  1. W !,"Because there is currently no way to distinguish between non-managed care "
  1. W !,"and managed care in RPMS, UDS will only calculate the total counts (lines 3,"
  1. W !,"6, 9, 12, and 14) for columns a, b, and d."
  1. W !
  1. Q
  1. QUARTER ;
  1. S BUDQTR=""
  1. S DIR("?",1)="Select the quarter you want to report on"
  1. S DIR("?",2)=" 1 January 1 - March 31"
  1. S DIR("?",3)=" 2 April 1 - June 30"
  1. S DIR("?",4)=" 3 July 1 - September 30"
  1. S DIR("?",5)=" 4 October 1 - December 31"
  1. S DIR("?",6)=" F Full Calender Year January 1 - December 31"
  1. S DIR(0)="S^1:1st Quarter (January 1 - March 31);2:2nd Quarter (April 1 - June 30);3:3rd Quarter (July 1 - September 30);4:4th Quarter (October 1 - December 31);F:Full Calendar Year (January 1 - December 31)"
  1. S DIR("A")="Choose the time period to report on",DIR("B")="F" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT)!(Y="") S BUDQUIT="" Q
  1. S BUDQTR=Y
  1. I Y=1 S BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"0331"
  1. I Y=2 S BUDBD=$E(BUDYEAR,1,3)_"0401",BUDED=$E(BUDYEAR,1,3)_"0630"
  1. I Y=3 S BUDBD=$E(BUDYEAR,1,3)_"0701",BUDED=$E(BUDYEAR,1,3)_"0930"
  1. I Y=4 S BUDBD=$E(BUDYEAR,1,3)_"1001",BUDED=$E(BUDYEAR,1,3)_"1231"
  1. I Y="F" S BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"1231"
  1. W !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
  1. Q
  1. YEAR ;
  1. S BUDYEAR=""
  1. W !
  1. W !,"Enter the Calendar Year. Use a 4 digit year, e.g. 2003, 2007"
  1. S DIR(0)="D^::EP"
  1. S DIR("A")="Enter Calendar Year"
  1. S DIR("?")="This report is compiled for a period. Enter a valid date."
  1. D ^DIR KILL DIR
  1. K DIC
  1. I $D(DUOUT) S DIRUT=1 Q
  1. I $D(DIRUT) Q
  1. I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G YEAR
  1. S BUDYEAR=Y,BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"1231"
  1. S BUDCAD=$E(BUDYEAR,1,3)_"0630"
  1. Q
  1. EOJ ;
  1. D EN^XBVK("BUD")
  1. Q
  1. GENI ;general introductions
  1. W:$D(IOF) @(IOF)
  1. W !!,$$CTR($$LOC,80),!,$$CTR("UDS 2014",80),!
  1. W !,"UDS searches your database to find all visits and related patients"
  1. W !,"during the time period selected. Based on the UDS definition, to be considered"
  1. W !,"a patient the patient must have had at least one visit meeting the following"
  1. W !,"criteria:"
  1. W !?4,"- must be to a location specified in your visit location setup"
  1. W !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
  1. W !?6,"Surgery (S), Observation (O), Telemedicine (M), Nursing home visit (R), "
  1. W !?6,"or In-Hospital (I) visit"
  1. W !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
  1. W !?4,"- must have a primary provider and a coded purpose of visit"
  1. W !?4,"- the patient must NOT have a gender of 'Unknown'"
  1. Q:'$D(BUDXXXXX)
  1. W !
  1. W !,"NOTE: Tables 6B and 7 must be run using the Full Calendar Year option."
  1. W !,"If these reports are run using the Quarterly options, the totals combined"
  1. W !,"will not match the yearly totals."
  1. W !
  1. D PAUSE^BUDBRP7
  1. Q
  1. ;
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP - Return location name from file 4 based on DUZ(2).
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
  1. ;----------
  1. NRY ;
  1. W !!,"not developed yet....." H 3
  1. Q
  1. GETDIR() ;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
  1. ;
  1. DELF ;
  1. S BUDFILE="",BUDDELT="F"
  1. W !!,"You have selected to create a delimited output file for Table 9D. "
  1. ;W !,"You can have this output file created as a text file in the pub directory, "
  1. ;W !,"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"
  1. ;W !,"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) Q
  1. I Y["/"!(Y["\") W !!!,"Your filename cannot contain a '/' or a '\'." H 2 G PT1
  1. S BUDFILE=Y
  1. W !!,"When the report is finished your delimited output will be found in the",!,BUDDIR," directory. The filename will be ",BUDFILE,".txt",!
  1. Q