- BUDHRPT2 ;IHS/CMI/LAB - UDS REPORT;
- ;;13.0;IHS/RPMS UNIFORM DATA SYSTEM;;OCT 12, 2018;Build 90
- ;
- ;
- Q ;not at top
- ;
- EN ;EP
- D EOJ
- EN1 ;
- S BUDSITE=""
- W ! S DIC="^BUDHSITE(",DIC(0)="AEMQ",DIC("A")="Enter your site: " D ^DIC
- I Y=-1 D EOJ Q
- S BUDSITE=+Y
- I '$O(^BUDHSITE(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
- D TAXCHK^BUDHXTCH
- D YEAR
- I BUDYEAR="" W !!,"Year not entered.",! D EOJ Q
- D QUARTER ;get time period
- I BUDQTR="" W !,"Time period not entered." D EOJ Q
- ;get indian or not
- S BUDBEN=""
- I $G(BUDXXXXX) 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"
- I '$G(BUDXXXXX) D
- .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)"_$S($$HL^BUDHRPT1():";4:Homeless Patients",1:"")
- .S DIR("A")="Select Beneficiary Population to include in this report"
- S DIR("B")="1" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) W !!,"Classification not entered." D EOJ Q
- S BUDBEN=Y
- W !!,"Depending on the size of your database, this report may take 2-4 hours to run"
- W !,"and produce patient reports that are hundreds of pages long. It is recommended"
- W !,"that these reports be run at night and printed to an electronic file, rather "
- W !,"than directly to a printer."
- W !
- S DIR(0)="Y",DIR("A")="Do you want to exit this program now",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) D EOJ Q
- I Y D EOJ Q
- ;S XBRP="PRINT^BUDHRPTP",XBRC="PROC^BUDHRPTC",XBRX="EOJ^BUDHRPT2",XBNS="BUD"
- ;D ^XBDBQUE
- ;D EOJ
- D PT^BUDHRPTE
- I BUDROT="" G EN1
- ZIS ;call to XBDBQUE
- K IOP,%ZIS I BUDROT="D",BUDDELT="F" D NODEV,EOJ Q
- W !! S %ZIS=$S(BUDDELT'="S":"PQM",1:"PM") D ^%ZIS
- ZIS1 ;
- I POP W !,"Report Aborted" D EOJ Q
- I $D(IO("Q")) G TSKMN
- DRIVER ;
- D PROC^BUDHRPTC
- U IO
- D PRINT^BUDHRPTP
- D ^%ZISC
- S:$D(ZTQUEUED) ZTREQ="@"
- D EOJ
- Q
- NODEV ;
- S XBRP="",XBRC="NODEV1^BUDHRPT2",XBRX="EOJ^BUDHRPT2",XBNS="BUD"
- D ^XBDBQUE
- Q
- NODEV1 ;
- D PROC^BUDHRPTC
- D PRINT^BUDHRPTP
- D ^%ZISC
- D EOJ
- Q
- TSKMN ;EP ENTRY POINT FROM TASKMAN
- S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
- I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
- I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
- K ZTSAVE S ZTSAVE("BUD*")=""
- S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^BUDHRPT2",ZTDTH="",ZTDESC="UDS 18 REPORT" D ^%ZTLOAD D EOJ Q
- Q
- M ;EP - called from option
- D EOJ
- S BUDXXXXX=1,BUDTSCTC=0
- D GENI
- K BUDT3A,BUDT3B,BUDT5,BUDT5L,BUDT5L1,BUDT6,BUDT6L,BUDT5L2,BUDT5L3
- W "UDS Patient and Provider List Selection"
- W !!?5,"1 All Patients w/Visits by ZIP Code and Insurance Source"
- W !?5,"2 All Patients w/Visits, by Age & Sex Assigned at Birth (Tables 3A)"
- W !?5,"3 All Patients w/Visits, by Hispanic or Latino Identity & Race (Table 3B)"
- W !?5,"4 Income Percent of Poverty Level (Table 4)"
- W !?5,"5 Principal Third-Party Medical Insurance Source (Table 4)"
- W !?5,"6 Characteristics of Special Populations (Table 4)"
- W !?5,"7 Provider/Staff List (Table 5 col A)"
- W !?5,"8 All patients by Service Category (Table 5 col B&C)"
- W !?5,"9 All Visits w/Uncategorized Primary Prov (Table 5 col B&C)"
- W !?5,"10 All Patients by Diagnosis (Table 6A)"
- W !?5,"11 ALL Patient Lists for LST1 -Sub Menu"
- S DIR(0)="L^1:11",DIR("A")="Include which Lists",DIR("B")=1 KILL DA D ^DIR KILL DIR
- I $D(DIRUT) D EOJ Q
- F X=1:1 S Z=$P(Y,",",X) Q:Z="" D
- .I Z=11 S (BUDT3A,BUDT3B,BUDT3BRL,BUDT4,BUDT4IPP,BUDT4PMI,BUDT4CHA,BUDT5,BUDT6,BUDT3AL,BUDT5L,BUDT5L1,BUDT6L,BUDTZ,BUDTZL,BUDT5L2)=1,BUDTSCTC=16
- .I Z=2 S (BUDT3A,BUDT3AL)=1,BUDTSCTC=BUDTSCTC+2
- .I Z=3 S (BUDT3B,BUDT3BRL)=1,BUDTSCTC=BUDTSCTC+2
- .I Z=4 S (BUDT4,BUDT4IPP)=1,BUDTSCTC=BUDTSCTC+2
- .I Z=5 S (BUDT4,BUDT4PMI)=1,BUDTSCTC=BUDTSCTC+$S(Y[4:1,1:2)
- .I Z=6 S (BUDT4,BUDT4CHA)=1,BUDTSCTC=BUDTSCTC+$S(Y[4:1,Y[5:1,1:2)
- .I Z=7 S (BUDT5,BUDT5L1)=1,BUDTSCTC=BUDTSCTC+2
- .I Z=8 S (BUDT5,BUDT5L)=1,BUDTSCTC=BUDTSCTC+$S(Y[7:1,1:2)
- .I Z=9 S (BUDT5,BUDT5L2)=1,BUDTSCTC=BUDTSCTC+$S(Y[7:1,Y[8:1,1:2)
- .I Z=10 S (BUDT6,BUDT6L)=1,BUDTSCTC=BUDTSCTC+2
- .I Z=1 S (BUDTZ,BUDTZL)=1,BUDTSCTC=BUDTSCTC+2
- G EN1
- ;
- T3A ;EP - entry point for Table 3A only
- D EOJ
- S (BUDT3A,BUDT3AL)=1,BUDTSCTC=2
- D GENI
- D T3AI
- G EN1
- ;
- T4IPPL ;EP - called from option
- D EOJ
- S BUDT4IPP=1,BUDT4=1,BUDTSCTC=2
- D GENI
- D T4IPPLI
- G EN1
- ;
- ;
- T4IPPLI ;intro for table 3A
- W !!,"INCOME PERCENT OF POVERTY LEVEL (TABLE 4)"
- W !,"This report provides a list of all patients with an income percent "
- W !,"of poverty level (=<100%, 101-150%, 151-200% >200%, Unknown) during"
- W !,"the report period."
- W !
- Q
- ;
- T4PMIS ;EP - called from option
- D EOJ
- S BUDT4PMI=1,BUDT4=1,BUDTSCTC=2
- D GENI
- D T4IPMIS
- G EN1
- ;
- ;
- T4IPMIS ;intro for table 4 PMIS
- W !!,"PRINCIPAL THIRD-PARTY MEDICAL INSURANCE SOURCE (TABLE 4)"
- W !,"This report will provide a list of all patients and the type of medical"
- W !,"insurance the patient had as of the patient's last visit during the"
- W !,"report period."
- W !
- Q
- T4CHAR ;EP - called from option
- D EOJ
- S BUDT4CHA=1,BUDT4=1,BUDTSCTC=2
- D GENI
- D T4ICHAR
- G EN1
- ;
- ;
- T4ICHAR ;intro for table 4 CHAR
- W !!,"CHARACTERISTICS OF SPECIAL POPULATIONS (TABLE 4)"
- W !,"This report provides a list of all patients who are migrant workers,"
- W !,"seasonal workers, homeless, school based health center patients, or"
- W !,"a veteran during the report period."
- W !
- Q
- TUSVE ;EP
- D EOJ
- S (BUDT3B,BUDT3BEL)=1,BUDTSCTC=2
- D GENI
- D T3BEI
- G EN1
- ;
- TUSVR ;EP
- D EOJ
- S (BUDT3B,BUDT3BRL)=1,BUDTSCTC=2
- D GENI
- D T3BRI
- G EN1
- ;
- T3AI ;intro for table 3A
- W !!,"ALL PATIENTS BY AGE & SEX ASSIGNED AT BIRTH (Tables 3A)"
- W !,"This report lists all patients who have at least one visit for the specified"
- W !,"time period that meets the visit definition criteria. Sorted by community, "
- W !,"age, and sex assigned at birth and lists all visits that fit the definition. "
- W !,"Age on the patient list is calculated as of June 30th of the report year."
- Q
- T3BRI ;intro for table 3B - RACE
- W !!,"ALL PATIENTS BY DEMOGRAPHIC CHARACTERISTICS (Tables 3B)"
- W !,"This report lists all patients by Hispanic or Latino Identity/Race/Language/"
- W !,"sexual orientation/gender identity who have at least one visit for the "
- W !,"specified time period that meets the visit definition criteria. Sorted by "
- W !,"race/Hispanic identity, age, gender, and community and lists all visits"
- W !,"that fit the definition. "
- W !,"Age on the patient list is calculated as of June 30th of the report year."
- W !,""
- Q
- T3BEI ;intro for table 3B - RACE
- W !!,"ALL PATIENTS BY ETHNICITY (TABLE 3B)"
- W !,"This report lists all patients who have at least on visit for the specified"
- W !,"time period that meet the above criteria. Sorted by ethncicity, age, sex "
- W !,"and community."
- W !,"Lists all visits that fit the definition. Age is calculated as of June 30th"
- W !,"of the report year."
- Q
- TZ ;EP - entry point for Table 3A only
- D EOJ
- S (BUDTZ,BUDTZL)=1,BUDTSCTC=2
- D GENI
- D TZAI
- G EN1
- TZAI ;intro for table Z
- W !!,"Patients by Zip Code"
- W !,"The Patient Zip Code table reports the number of patients"
- W !,"by their most recent (last) zip code as entered in patient registration and"
- W !,"their primary health insurance source as of the last visit during the "
- W !,"report period."
- Q
- T5 ;EP
- D EOJ
- S BUDT5=1,BUDT5L=1,BUDTSCTC=2
- D GENI
- D T5I
- G EN1
- ;
- T5I ;
- W !,"ALL PATIENTS BY SERVICE CATEGORY (Table 5, columns b and c)"
- W !,"This report lists all patients and related visits as defined above, categorized"
- W !,"by UDS-defined service categories (primary provider code). Sorted by"
- W !,"community, age and gender. See UDS User Manual for how UDS disciplines are"
- W !,"mapped to RPMS provider codes."
- Q
- T5B ;EP
- D EOJ
- S BUDT5=1,BUDT5L2=1,BUDTSCTC=2
- D GENI
- D T5BI
- G EN1
- ;
- T5BI ;
- W !,"ALL PATIENTS FOR UNCATEGORIZED PROVIDER VISITS (Table 5, columns b and c)"
- W !,"This report lists all patients and related visits as defined above, that"
- W !,"are not counted toward Table 5 because the primary provider code could not "
- W !,"be categorized by UDS-defined service categories. Sorted by community, age"
- W !,"and gender. See UDS User Manual for how UDS disciplines are mapped to RPMS"
- W !,"provider codes."
- Q
- T6 ;EP - entry point for Table 6A only
- D EOJ
- S (BUDT6,BUDT6L)=1,BUDTSCTC=2
- D GENI
- D T6I
- G EN1
- ;
- T6I ;intro for table 6
- W !,"ALL PATIENTS BY DIAGNOSIS (Table 6A)"
- W !,"This report lists all patients and related visits as defined above, categorized"
- W !,"by specific UDS-defined diagnoses or tests/screenings. Sorted by"
- W !,"community, age and gender."
- Q
- T5A ;EP - called from option
- D EOJ
- S (BUDT5,BUDT5L1)=1,BUDTSCTC=2
- D GENI
- D T5AI
- G EN1
- T5AI ;
- W !,"PROVIDER/STAFF LIST (Table 5 column a)"
- W !,"This report provides a list of all Providers and other facility staff who are"
- W !,"documented in RPMS categorized by UDS-defined service categories. Use this"
- W !,"list to manually calculate FTEs for each staff category to document in Table"
- W !,"5 column a (FTEs)."
- Q
- TOL ;EP
- D EOJ
- S (BUDT6,BUDTOL)=1,BUDTSCTC=2
- D GENI
- D TOLI
- G EN1
- TOLI ;
- W !,"This report will list any visit that is incomplete but has a service",!,"relevant to lines 21 through 26 of Table 6A attached to it."
- W !,"Incomplete visits are not looked at when generating this report so ",!,"this list will provide you with a list of visits that potentially should be "
- W !,"completed or merged to a complete visit in order to be counted in Table 6A"
- Q
- ;
- T5C ;EP
- D EOJ
- S BUDT5=1,BUDT5L3=1,BUDTSCTC=2
- D GENI
- D T5CI
- G EN1
- ;
- T5CI ;
- W !,"ALL PATIENTS W/MULTIPLE VISIS IN SVC CATS (TABLE 5 COL B&C)"
- W !,"This report provides a list of patients who had more than one visit on"
- W !,"a single day for any of the six BPHC Service Categories. Per the BPHC "
- W !,"Uniform Data System Manual, 2007 Revision, page 6 each patient may have, "
- W !,"at a maximum:"
- W !,"- One medical visit (Line 15)"
- W !,"- One dental visit (Line 19)"
- W !,"- One mental health visit (Line 20)"
- W !,"- One substance abuse visit (Line 21)"
- W !,"- One 'other health' visit for each type of 'other health' provider"
- W !," (e.g. nutritionist, podiatrist, speech therapist, acupuncturist, "
- W !," optometrist) (Line 22)"
- W !,"- One enabling service visit for each type of enabling provider"
- W !," (e.g. case management or health education) (Line 29)"
- Q
- QUARTER ;
- S BUDQTR=""
- S DIR("?",1)="Choose the time period to report on"
- S DIR("?",2)=" 1 January 1 - March 31"
- S DIR("?",3)=" 2 April 1 - June 30"
- S DIR("?",4)=" 3 July 1 - September 30"
- S DIR("?",5)=" 4 October 1 - December 31"
- S DIR("?",6)=" F Full Calender Year January 1 - December 31"
- 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)"
- S DIR("A")="Choose the time period to report on",DIR("B")="F" KILL DA D ^DIR KILL DIR
- I $D(DIRUT)!(Y="") S BUDQUIT="" Q
- S BUDQTR=Y
- I Y=1 S BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"0331"
- I Y=2 S BUDBD=$E(BUDYEAR,1,3)_"0401",BUDED=$E(BUDYEAR,1,3)_"0630"
- I Y=3 S BUDBD=$E(BUDYEAR,1,3)_"0701",BUDED=$E(BUDYEAR,1,3)_"0930"
- I Y=4 S BUDBD=$E(BUDYEAR,1,3)_"1001",BUDED=$E(BUDYEAR,1,3)_"1231"
- I Y="F" S BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"1231"
- S BUDXXBD=$E(BUDBD,1,3)_"0101",BUDXXED=$E(BUDED,1,3)_"1231" ;maw 07092018 moved from BUDHRPT1 since this appears to be needed
- W !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
- Q
- YEAR ;
- S BUDYEAR=""
- W !
- W !,"Enter the Calendar Year. Use a 4 digit year, e.g. 2018"
- S DIR(0)="D^::EP"
- S DIR("A")="Enter Calendar Year"
- S DIR("?")="This report is compiled for a period. Enter a valid date."
- D ^DIR KILL DIR
- K DIC
- I $D(DUOUT) S DIRUT=1 Q
- I $D(DIRUT) Q
- I $E(Y,4,7)'="0000" W !!,"Please enter a year only!",! G YEAR
- S BUDYEAR=Y,BUDBD=$E(BUDYEAR,1,3)_"0101",BUDED=$E(BUDYEAR,1,3)_"1231"
- S BUDCCAD=$E(BUDYEAR,1,3)_"0630"
- Q
- EOJ ;
- D EN^XBVK("BUD")
- Q
- GENI ;general introductions
- W:$D(IOF) @IOF
- W !,$$CTR($$LOC,80)
- W !,$$CTR("UDS 2018",80)
- W !,"NOTE: Patient lists may be hundreds of pages long, depending on the size of"
- W !,"your patient population. It is recommended that you run these reports at "
- W !,"night and print to an electronic file, not directly to a printer.",!
- K DIR S DIR(0)="E",DIR("A")="Press Enter to Continue" D ^DIR K DIR
- W !!,"The Patient List option documents the individual patients and visits"
- W !,"that are counted and summarized on each Table report (main menu"
- W !,"option REP). The summary Table report is included at the beginning of each"
- W !,"List report."
- W !,"UDS searches your database to find all visits and related patients"
- W !,"during the time period selected. Based on the UDS definition, to be counted"
- W !,"as a patient, the patient must have had at least one visit meeting the "
- W !,"following criteria:"
- W !?4,"- must be to a location specified in your visit location setup"
- W !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
- W !?6,"Surgery (S), Observation (O), Telemedicine (M), Nursing home visit (R), "
- W !?6,"or In-Hospital (I) visit"
- W !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
- W !?4,"- must have a primary provider and a coded purpose of visit"
- W !?4,"- the patient must NOT have a gender of 'Unknown'"
- W !
- Q
- ;
- CTR(X,Y) ;EP - Center X in a field Y wide.
- Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
- ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- ;----------
- BUDHRPT2 ;IHS/CMI/LAB - UDS REPORT;
- +1 ;;13.0;IHS/RPMS UNIFORM DATA SYSTEM;;OCT 12, 2018;Build 90
- +2 ;
- +3 ;
- +4 ;not at top
- QUIT
- +5 ;
- EN ;EP
- +1 DO EOJ
- EN1 ;
- +1 SET BUDSITE=""
- +2 WRITE !
- SET DIC="^BUDHSITE("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Enter your site: "
- DO ^DIC
- +3 IF Y=-1
- DO EOJ
- QUIT
- +4 SET BUDSITE=+Y
- +5 IF '$ORDER(^BUDHSITE(BUDSITE,11,0))
- WRITE !!,"Warning: There are no locations defined in the site parameter file for this",!,"site. Report will not be accurate!"
- GOTO EN
- +6 DO TAXCHK^BUDHXTCH
- +7 DO YEAR
- +8 IF BUDYEAR=""
- WRITE !!,"Year not entered.",!
- DO EOJ
- QUIT
- +9 ;get time period
- DO QUARTER
- +10 IF BUDQTR=""
- WRITE !,"Time period not entered."
- DO EOJ
- QUIT
- +11 ;get indian or not
- +12 SET BUDBEN=""
- +13 IF $GET(BUDXXXXX)
- SET 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)"
- SET DIR("A")="Select Beneficiary Population to include in this report"
- +14 IF '$GET(BUDXXXXX)
- Begin DoDot:1
- +15 SET 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)"_$SELECT($$HL^BUDHRPT1():";4:Homeless Patients",1:"")
- +16 SET DIR("A")="Select Beneficiary Population to include in this report"
- End DoDot:1
- +17 SET DIR("B")="1"
- KILL DA
- DO ^DIR
- KILL DIR
- +18 IF $DATA(DIRUT)
- WRITE !!,"Classification not entered."
- DO EOJ
- QUIT
- +19 SET BUDBEN=Y
- +20 WRITE !!,"Depending on the size of your database, this report may take 2-4 hours to run"
- +21 WRITE !,"and produce patient reports that are hundreds of pages long. It is recommended"
- +22 WRITE !,"that these reports be run at night and printed to an electronic file, rather "
- +23 WRITE !,"than directly to a printer."
- +24 WRITE !
- +25 SET DIR(0)="Y"
- SET DIR("A")="Do you want to exit this program now"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +26 IF $DATA(DIRUT)
- DO EOJ
- QUIT
- +27 IF Y
- DO EOJ
- QUIT
- +28 ;S XBRP="PRINT^BUDHRPTP",XBRC="PROC^BUDHRPTC",XBRX="EOJ^BUDHRPT2",XBNS="BUD"
- +29 ;D ^XBDBQUE
- +30 ;D EOJ
- +31 DO PT^BUDHRPTE
- +32 IF BUDROT=""
- GOTO EN1
- ZIS ;call to XBDBQUE
- +1 KILL IOP,%ZIS
- IF BUDROT="D"
- IF BUDDELT="F"
- DO NODEV
- DO EOJ
- QUIT
- +2 WRITE !!
- SET %ZIS=$SELECT(BUDDELT'="S":"PQM",1:"PM")
- DO ^%ZIS
- ZIS1 ;
- +1 IF POP
- WRITE !,"Report Aborted"
- DO EOJ
- QUIT
- +2 IF $DATA(IO("Q"))
- GOTO TSKMN
- DRIVER ;
- +1 DO PROC^BUDHRPTC
- +2 USE IO
- +3 DO PRINT^BUDHRPTP
- +4 DO ^%ZISC
- +5 IF $DATA(ZTQUEUED)
- SET ZTREQ="@"
- +6 DO EOJ
- +7 QUIT
- NODEV ;
- +1 SET XBRP=""
- SET XBRC="NODEV1^BUDHRPT2"
- SET XBRX="EOJ^BUDHRPT2"
- SET XBNS="BUD"
- +2 DO ^XBDBQUE
- +3 QUIT
- NODEV1 ;
- +1 DO PROC^BUDHRPTC
- +2 DO PRINT^BUDHRPTP
- +3 DO ^%ZISC
- +4 DO EOJ
- +5 QUIT
- TSKMN ;EP ENTRY POINT FROM TASKMAN
- +1 SET ZTIO=$SELECT($DATA(ION):ION,1:IO)
- IF $DATA(IOST)#2
- IF IOST]""
- SET ZTIO=ZTIO_";"_IOST
- +2 IF $GET(IO("DOC"))]""
- SET ZTIO=ZTIO_";"_$GET(IO("DOC"))
- +3 IF $DATA(IOM)#2
- IF IOM
- SET ZTIO=ZTIO_";"_IOM
- IF $DATA(IOSL)#2
- IF IOSL
- SET ZTIO=ZTIO_";"_IOSL
- +4 KILL ZTSAVE
- SET ZTSAVE("BUD*")=""
- +5 SET ZTCPU=$GET(IOCPU)
- SET ZTRTN="DRIVER^BUDHRPT2"
- SET ZTDTH=""
- SET ZTDESC="UDS 18 REPORT"
- DO ^%ZTLOAD
- DO EOJ
- QUIT
- +6 QUIT
- M ;EP - called from option
- +1 DO EOJ
- +2 SET BUDXXXXX=1
- SET BUDTSCTC=0
- +3 DO GENI
- +4 KILL BUDT3A,BUDT3B,BUDT5,BUDT5L,BUDT5L1,BUDT6,BUDT6L,BUDT5L2,BUDT5L3
- +5 WRITE "UDS Patient and Provider List Selection"
- +6 WRITE !!?5,"1 All Patients w/Visits by ZIP Code and Insurance Source"
- +7 WRITE !?5,"2 All Patients w/Visits, by Age & Sex Assigned at Birth (Tables 3A)"
- +8 WRITE !?5,"3 All Patients w/Visits, by Hispanic or Latino Identity & Race (Table 3B)"
- +9 WRITE !?5,"4 Income Percent of Poverty Level (Table 4)"
- +10 WRITE !?5,"5 Principal Third-Party Medical Insurance Source (Table 4)"
- +11 WRITE !?5,"6 Characteristics of Special Populations (Table 4)"
- +12 WRITE !?5,"7 Provider/Staff List (Table 5 col A)"
- +13 WRITE !?5,"8 All patients by Service Category (Table 5 col B&C)"
- +14 WRITE !?5,"9 All Visits w/Uncategorized Primary Prov (Table 5 col B&C)"
- +15 WRITE !?5,"10 All Patients by Diagnosis (Table 6A)"
- +16 WRITE !?5,"11 ALL Patient Lists for LST1 -Sub Menu"
- +17 SET DIR(0)="L^1:11"
- SET DIR("A")="Include which Lists"
- SET DIR("B")=1
- KILL DA
- DO ^DIR
- KILL DIR
- +18 IF $DATA(DIRUT)
- DO EOJ
- QUIT
- +19 FOR X=1:1
- SET Z=$PIECE(Y,",",X)
- IF Z=""
- QUIT
- Begin DoDot:1
- +20 IF Z=11
- SET (BUDT3A,BUDT3B,BUDT3BRL,BUDT4,BUDT4IPP,BUDT4PMI,BUDT4CHA,BUDT5,BUDT6,BUDT3AL,BUDT5L,BUDT5L1,BUDT6L,BUDTZ,BUDTZL,BUDT5L2)=1
- SET BUDTSCTC=16
- +21 IF Z=2
- SET (BUDT3A,BUDT3AL)=1
- SET BUDTSCTC=BUDTSCTC+2
- +22 IF Z=3
- SET (BUDT3B,BUDT3BRL)=1
- SET BUDTSCTC=BUDTSCTC+2
- +23 IF Z=4
- SET (BUDT4,BUDT4IPP)=1
- SET BUDTSCTC=BUDTSCTC+2
- +24 IF Z=5
- SET (BUDT4,BUDT4PMI)=1
- SET BUDTSCTC=BUDTSCTC+$SELECT(Y[4:1,1:2)
- +25 IF Z=6
- SET (BUDT4,BUDT4CHA)=1
- SET BUDTSCTC=BUDTSCTC+$SELECT(Y[4:1,Y[5:1,1:2)
- +26 IF Z=7
- SET (BUDT5,BUDT5L1)=1
- SET BUDTSCTC=BUDTSCTC+2
- +27 IF Z=8
- SET (BUDT5,BUDT5L)=1
- SET BUDTSCTC=BUDTSCTC+$SELECT(Y[7:1,1:2)
- +28 IF Z=9
- SET (BUDT5,BUDT5L2)=1
- SET BUDTSCTC=BUDTSCTC+$SELECT(Y[7:1,Y[8:1,1:2)
- +29 IF Z=10
- SET (BUDT6,BUDT6L)=1
- SET BUDTSCTC=BUDTSCTC+2
- +30 IF Z=1
- SET (BUDTZ,BUDTZL)=1
- SET BUDTSCTC=BUDTSCTC+2
- End DoDot:1
- +31 GOTO EN1
- +32 ;
- T3A ;EP - entry point for Table 3A only
- +1 DO EOJ
- +2 SET (BUDT3A,BUDT3AL)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T3AI
- +5 GOTO EN1
- +6 ;
- T4IPPL ;EP - called from option
- +1 DO EOJ
- +2 SET BUDT4IPP=1
- SET BUDT4=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T4IPPLI
- +5 GOTO EN1
- +6 ;
- +7 ;
- T4IPPLI ;intro for table 3A
- +1 WRITE !!,"INCOME PERCENT OF POVERTY LEVEL (TABLE 4)"
- +2 WRITE !,"This report provides a list of all patients with an income percent "
- +3 WRITE !,"of poverty level (=<100%, 101-150%, 151-200% >200%, Unknown) during"
- +4 WRITE !,"the report period."
- +5 WRITE !
- +6 QUIT
- +7 ;
- T4PMIS ;EP - called from option
- +1 DO EOJ
- +2 SET BUDT4PMI=1
- SET BUDT4=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T4IPMIS
- +5 GOTO EN1
- +6 ;
- +7 ;
- T4IPMIS ;intro for table 4 PMIS
- +1 WRITE !!,"PRINCIPAL THIRD-PARTY MEDICAL INSURANCE SOURCE (TABLE 4)"
- +2 WRITE !,"This report will provide a list of all patients and the type of medical"
- +3 WRITE !,"insurance the patient had as of the patient's last visit during the"
- +4 WRITE !,"report period."
- +5 WRITE !
- +6 QUIT
- T4CHAR ;EP - called from option
- +1 DO EOJ
- +2 SET BUDT4CHA=1
- SET BUDT4=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T4ICHAR
- +5 GOTO EN1
- +6 ;
- +7 ;
- T4ICHAR ;intro for table 4 CHAR
- +1 WRITE !!,"CHARACTERISTICS OF SPECIAL POPULATIONS (TABLE 4)"
- +2 WRITE !,"This report provides a list of all patients who are migrant workers,"
- +3 WRITE !,"seasonal workers, homeless, school based health center patients, or"
- +4 WRITE !,"a veteran during the report period."
- +5 WRITE !
- +6 QUIT
- TUSVE ;EP
- +1 DO EOJ
- +2 SET (BUDT3B,BUDT3BEL)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T3BEI
- +5 GOTO EN1
- +6 ;
- TUSVR ;EP
- +1 DO EOJ
- +2 SET (BUDT3B,BUDT3BRL)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T3BRI
- +5 GOTO EN1
- +6 ;
- T3AI ;intro for table 3A
- +1 WRITE !!,"ALL PATIENTS BY AGE & SEX ASSIGNED AT BIRTH (Tables 3A)"
- +2 WRITE !,"This report lists all patients who have at least one visit for the specified"
- +3 WRITE !,"time period that meets the visit definition criteria. Sorted by community, "
- +4 WRITE !,"age, and sex assigned at birth and lists all visits that fit the definition. "
- +5 WRITE !,"Age on the patient list is calculated as of June 30th of the report year."
- +6 QUIT
- T3BRI ;intro for table 3B - RACE
- +1 WRITE !!,"ALL PATIENTS BY DEMOGRAPHIC CHARACTERISTICS (Tables 3B)"
- +2 WRITE !,"This report lists all patients by Hispanic or Latino Identity/Race/Language/"
- +3 WRITE !,"sexual orientation/gender identity who have at least one visit for the "
- +4 WRITE !,"specified time period that meets the visit definition criteria. Sorted by "
- +5 WRITE !,"race/Hispanic identity, age, gender, and community and lists all visits"
- +6 WRITE !,"that fit the definition. "
- +7 WRITE !,"Age on the patient list is calculated as of June 30th of the report year."
- +8 WRITE !,""
- +9 QUIT
- T3BEI ;intro for table 3B - RACE
- +1 WRITE !!,"ALL PATIENTS BY ETHNICITY (TABLE 3B)"
- +2 WRITE !,"This report lists all patients who have at least on visit for the specified"
- +3 WRITE !,"time period that meet the above criteria. Sorted by ethncicity, age, sex "
- +4 WRITE !,"and community."
- +5 WRITE !,"Lists all visits that fit the definition. Age is calculated as of June 30th"
- +6 WRITE !,"of the report year."
- +7 QUIT
- TZ ;EP - entry point for Table 3A only
- +1 DO EOJ
- +2 SET (BUDTZ,BUDTZL)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO TZAI
- +5 GOTO EN1
- TZAI ;intro for table Z
- +1 WRITE !!,"Patients by Zip Code"
- +2 WRITE !,"The Patient Zip Code table reports the number of patients"
- +3 WRITE !,"by their most recent (last) zip code as entered in patient registration and"
- +4 WRITE !,"their primary health insurance source as of the last visit during the "
- +5 WRITE !,"report period."
- +6 QUIT
- T5 ;EP
- +1 DO EOJ
- +2 SET BUDT5=1
- SET BUDT5L=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T5I
- +5 GOTO EN1
- +6 ;
- T5I ;
- +1 WRITE !,"ALL PATIENTS BY SERVICE CATEGORY (Table 5, columns b and c)"
- +2 WRITE !,"This report lists all patients and related visits as defined above, categorized"
- +3 WRITE !,"by UDS-defined service categories (primary provider code). Sorted by"
- +4 WRITE !,"community, age and gender. See UDS User Manual for how UDS disciplines are"
- +5 WRITE !,"mapped to RPMS provider codes."
- +6 QUIT
- T5B ;EP
- +1 DO EOJ
- +2 SET BUDT5=1
- SET BUDT5L2=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T5BI
- +5 GOTO EN1
- +6 ;
- T5BI ;
- +1 WRITE !,"ALL PATIENTS FOR UNCATEGORIZED PROVIDER VISITS (Table 5, columns b and c)"
- +2 WRITE !,"This report lists all patients and related visits as defined above, that"
- +3 WRITE !,"are not counted toward Table 5 because the primary provider code could not "
- +4 WRITE !,"be categorized by UDS-defined service categories. Sorted by community, age"
- +5 WRITE !,"and gender. See UDS User Manual for how UDS disciplines are mapped to RPMS"
- +6 WRITE !,"provider codes."
- +7 QUIT
- T6 ;EP - entry point for Table 6A only
- +1 DO EOJ
- +2 SET (BUDT6,BUDT6L)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T6I
- +5 GOTO EN1
- +6 ;
- T6I ;intro for table 6
- +1 WRITE !,"ALL PATIENTS BY DIAGNOSIS (Table 6A)"
- +2 WRITE !,"This report lists all patients and related visits as defined above, categorized"
- +3 WRITE !,"by specific UDS-defined diagnoses or tests/screenings. Sorted by"
- +4 WRITE !,"community, age and gender."
- +5 QUIT
- T5A ;EP - called from option
- +1 DO EOJ
- +2 SET (BUDT5,BUDT5L1)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T5AI
- +5 GOTO EN1
- T5AI ;
- +1 WRITE !,"PROVIDER/STAFF LIST (Table 5 column a)"
- +2 WRITE !,"This report provides a list of all Providers and other facility staff who are"
- +3 WRITE !,"documented in RPMS categorized by UDS-defined service categories. Use this"
- +4 WRITE !,"list to manually calculate FTEs for each staff category to document in Table"
- +5 WRITE !,"5 column a (FTEs)."
- +6 QUIT
- TOL ;EP
- +1 DO EOJ
- +2 SET (BUDT6,BUDTOL)=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO TOLI
- +5 GOTO EN1
- TOLI ;
- +1 WRITE !,"This report will list any visit that is incomplete but has a service",!,"relevant to lines 21 through 26 of Table 6A attached to it."
- +2 WRITE !,"Incomplete visits are not looked at when generating this report so ",!,"this list will provide you with a list of visits that potentially should be "
- +3 WRITE !,"completed or merged to a complete visit in order to be counted in Table 6A"
- +4 QUIT
- +5 ;
- T5C ;EP
- +1 DO EOJ
- +2 SET BUDT5=1
- SET BUDT5L3=1
- SET BUDTSCTC=2
- +3 DO GENI
- +4 DO T5CI
- +5 GOTO EN1
- +6 ;
- T5CI ;
- +1 WRITE !,"ALL PATIENTS W/MULTIPLE VISIS IN SVC CATS (TABLE 5 COL B&C)"
- +2 WRITE !,"This report provides a list of patients who had more than one visit on"
- +3 WRITE !,"a single day for any of the six BPHC Service Categories. Per the BPHC "
- +4 WRITE !,"Uniform Data System Manual, 2007 Revision, page 6 each patient may have, "
- +5 WRITE !,"at a maximum:"
- +6 WRITE !,"- One medical visit (Line 15)"
- +7 WRITE !,"- One dental visit (Line 19)"
- +8 WRITE !,"- One mental health visit (Line 20)"
- +9 WRITE !,"- One substance abuse visit (Line 21)"
- +10 WRITE !,"- One 'other health' visit for each type of 'other health' provider"
- +11 WRITE !," (e.g. nutritionist, podiatrist, speech therapist, acupuncturist, "
- +12 WRITE !," optometrist) (Line 22)"
- +13 WRITE !,"- One enabling service visit for each type of enabling provider"
- +14 WRITE !," (e.g. case management or health education) (Line 29)"
- +15 QUIT
- QUARTER ;
- +1 SET BUDQTR=""
- +2 SET DIR("?",1)="Choose the time period to report on"
- +3 SET DIR("?",2)=" 1 January 1 - March 31"
- +4 SET DIR("?",3)=" 2 April 1 - June 30"
- +5 SET DIR("?",4)=" 3 July 1 - September 30"
- +6 SET DIR("?",5)=" 4 October 1 - December 31"
- +7 SET DIR("?",6)=" F Full Calender Year January 1 - December 31"
- +8 SET 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)"
- +9 SET DIR("A")="Choose the time period to report on"
- SET DIR("B")="F"
- KILL DA
- DO ^DIR
- KILL DIR
- +10 IF $DATA(DIRUT)!(Y="")
- SET BUDQUIT=""
- QUIT
- +11 SET BUDQTR=Y
- +12 IF Y=1
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0101"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"0331"
- +13 IF Y=2
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0401"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"0630"
- +14 IF Y=3
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0701"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"0930"
- +15 IF Y=4
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"1001"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"1231"
- +16 IF Y="F"
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0101"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"1231"
- +17 ;maw 07092018 moved from BUDHRPT1 since this appears to be needed
- SET BUDXXBD=$EXTRACT(BUDBD,1,3)_"0101"
- SET BUDXXED=$EXTRACT(BUDED,1,3)_"1231"
- +18 WRITE !!,"Your report will be run for the time period: ",$$FMTE^XLFDT(BUDBD)," to ",$$FMTE^XLFDT(BUDED)
- +19 QUIT
- YEAR ;
- +1 SET BUDYEAR=""
- +2 WRITE !
- +3 WRITE !,"Enter the Calendar Year. Use a 4 digit year, e.g. 2018"
- +4 SET DIR(0)="D^::EP"
- +5 SET DIR("A")="Enter Calendar Year"
- +6 SET DIR("?")="This report is compiled for a period. Enter a valid date."
- +7 DO ^DIR
- KILL DIR
- +8 KILL DIC
- +9 IF $DATA(DUOUT)
- SET DIRUT=1
- QUIT
- +10 IF $DATA(DIRUT)
- QUIT
- +11 IF $EXTRACT(Y,4,7)'="0000"
- WRITE !!,"Please enter a year only!",!
- GOTO YEAR
- +12 SET BUDYEAR=Y
- SET BUDBD=$EXTRACT(BUDYEAR,1,3)_"0101"
- SET BUDED=$EXTRACT(BUDYEAR,1,3)_"1231"
- +13 SET BUDCCAD=$EXTRACT(BUDYEAR,1,3)_"0630"
- +14 QUIT
- EOJ ;
- +1 DO EN^XBVK("BUD")
- +2 QUIT
- GENI ;general introductions
- +1 IF $DATA(IOF)
- WRITE @IOF
- +2 WRITE !,$$CTR($$LOC,80)
- +3 WRITE !,$$CTR("UDS 2018",80)
- +4 WRITE !,"NOTE: Patient lists may be hundreds of pages long, depending on the size of"
- +5 WRITE !,"your patient population. It is recommended that you run these reports at "
- +6 WRITE !,"night and print to an electronic file, not directly to a printer.",!
- +7 KILL DIR
- SET DIR(0)="E"
- SET DIR("A")="Press Enter to Continue"
- DO ^DIR
- KILL DIR
- +8 WRITE !!,"The Patient List option documents the individual patients and visits"
- +9 WRITE !,"that are counted and summarized on each Table report (main menu"
- +10 WRITE !,"option REP). The summary Table report is included at the beginning of each"
- +11 WRITE !,"List report."
- +12 WRITE !,"UDS searches your database to find all visits and related patients"
- +13 WRITE !,"during the time period selected. Based on the UDS definition, to be counted"
- +14 WRITE !,"as a patient, the patient must have had at least one visit meeting the "
- +15 WRITE !,"following criteria:"
- +16 WRITE !?4,"- must be to a location specified in your visit location setup"
- +17 WRITE !?4,"- must be to Service Category Ambulatory (A), Hospitalization (H), Day"
- +18 WRITE !?6,"Surgery (S), Observation (O), Telemedicine (M), Nursing home visit (R), "
- +19 WRITE !?6,"or In-Hospital (I) visit"
- +20 WRITE !?4,"- must NOT have an excluded clinic code (see User Manual for a list)"
- +21 WRITE !?4,"- must have a primary provider and a coded purpose of visit"
- +22 WRITE !?4,"- the patient must NOT have a gender of 'Unknown'"
- +23 WRITE !
- +24 QUIT
- +25 ;
- CTR(X,Y) ;EP - Center X in a field Y wide.
- +1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
- +2 ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- +1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- +2 ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- +1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- +2 ;----------