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

BUDHRPTD.m

Go to the documentation of this file.
  1. BUDHRPTD ;IHS/CMI/LAB - UDS REPORT PROCESSOR;
  1. ;;13.0;IHS/RPMS UNIFORM DATA SYSTEM;;OCT 12, 2018;Build 90
  1. ;
  1. ;
  1. GETV ;EP - get all visits for this patient and tally in BUDTV
  1. ;^TMP($J,"VISITS") has all visits
  1. ;^TMP($J,"VISITSUDSPT") for visit list for table 3A
  1. ;^TMP($J,"VISITSTABLE5") has all visits to count on table 5
  1. ;^TMP($J,"VISITSTABLE6A") has all visits for tables 6a dxs and services
  1. K ^TMP($J)
  1. S BUDUDSPT=0 ;controls whether the patient qualifies as a UDS patient
  1. S BUDMEDV=0 ;controls whether the patient had a medical visit & how many
  1. S BUDMEDVI="" ;contains the IEN of a medical visit
  1. S BUDLASTV="" ;contains the IEN of their last visit (table 5 eligible)
  1. S BUDFRSTV="" ;contains the IEN of their first visit (uds patient eligible)
  1. S A="^TMP($J,""VISITS"",",B=DFN_"^ALL VISITS;DURING "_$$FMTE^XLFDT(BUDBD)_"-"_$$FMTE^XLFDT(BUDED),E=$$START1^APCLDF(B,A)
  1. I '$D(^TMP($J,"VISITS",1)) Q
  1. ;loop and determine if they are a UDS patient
  1. S BUDX=0 F S BUDX=$O(^TMP($J,"VISITS",BUDX)) Q:BUDX'=+BUDX S BUDVSIT=$P(^TMP($J,"VISITS",BUDX),U,5) D
  1. .Q:'$D(^AUPNVSIT(BUDVSIT,0))
  1. .Q:'$P(^AUPNVSIT(BUDVSIT,0),U,9)
  1. .Q:$P(^AUPNVSIT(BUDVSIT,0),U,11)
  1. .S BUDVLOC=$P(^AUPNVSIT(BUDVSIT,0),U,6) ;must be to a location in the site parameter file
  1. .Q:BUDVLOC=""
  1. .Q:'$D(^BUDHSITE(BUDSITE,11,BUDVLOC)) ;not valid location
  1. .Q:"AHSORMI"'[$P(^AUPNVSIT(BUDVSIT,0),U,7) ;ignore cr/telephone/ events
  1. .;V12.0 ADD PROVIDER EXCLUSIONS
  1. .S J=$$PRIMPROV^APCLV(BUDVSIT,"F")
  1. .I J,$D(^BUDHSITE(BUDSITE,13,"B",J)) Q ;don't count visits with this class
  1. .S BUDCLINC=$$CLINIC^APCLV(BUDVSIT,"C")
  1. .S BUDTIEN=$O(^BUDHCNTL("B","UDS PT/TABLE 5 CLINIC EXCL",0))
  1. .I BUDCLINC]"",$D(^BUDHCNTL(BUDTIEN,11,"B",BUDCLINC)) Q ;don't count UDS PATIENT CLINIC EXCLUSIONS
  1. .S BUDPP=$$PRIMPROV^APCLV(BUDVSIT,"I") ;IEN of primary provider
  1. .I 'BUDPP Q ;no primary provider
  1. .S BUDPPD=$$PRIMPROV^APCLV(BUDVSIT,"D")
  1. .I BUDPPD="" Q ;has to have a discipline
  1. .I '$D(^AUPNVPOV("AD",BUDVSIT)) Q ;must have at least 1 pov to elimiate orphans
  1. .S BUDUDSPT=BUDUDSPT+1
  1. .S ^TMP($J,"VISITSUDSPT",BUDVSIT)="" ;THIS IS THE LIST FOR PAT LISTS FOR 3A, 3B, ZIP, 4
  1. .I $$VD^APCLV(BUDLASTV)<$$VD^APCLV(BUDVSIT) S BUDLASTV=BUDVSIT
  1. .I $$VD^APCLV(BUDVSIT)>$$VD^APCLV(BUDFRSTV) S BUDFRSTV=BUDVSIT
  1. Q:'BUDUDSPT ;QUIT IF THEY HAVE NO VISITS FOR PATIENT DEFINITION
  1. T5 ;now get visits for table 5 1 per provider type per day
  1. S BUDX=0 F S BUDX=$O(^TMP($J,"VISITS",BUDX)) Q:BUDX'=+BUDX S BUDVSIT=$P(^TMP($J,"VISITS",BUDX),U,5) D
  1. .Q:'$D(^AUPNVSIT(BUDVSIT,0))
  1. .Q:'$P(^AUPNVSIT(BUDVSIT,0),U,9) ;0 dependent entries, not a visit
  1. .Q:$P(^AUPNVSIT(BUDVSIT,0),U,11) ;deleted visit
  1. .S BUDVLOC=$P(^AUPNVSIT(BUDVSIT,0),U,6) ;must be to a location int he site parameter file
  1. .Q:BUDVLOC=""
  1. .Q:'$D(^BUDHSITE(BUDSITE,11,BUDVLOC)) ;not valid location
  1. .Q:"AHSORMI"'[$P(^AUPNVSIT(BUDVSIT,0),U,7) ;ignore cr/telephone
  1. .Q:'$D(^AUPNVPOV("AD",BUDVSIT))
  1. .S BUDCLINC=$$CLINIC^APCLV(BUDVSIT,"C")
  1. .S BUDTIEN=$O(^BUDHCNTL("B","UDS PT/TABLE 5 CLINIC EXCL",0))
  1. .I BUDCLINC]"",$D(^BUDHCNTL(BUDTIEN,11,"B",BUDCLINC)) Q ;don't count excluded clinics
  1. .S BUDPP=$$PRIMPROV^APCLV(BUDVSIT,"I") ;IEN of primary provider
  1. .I 'BUDPP Q ;no primary provider
  1. .;V13.0 ADD PROVIDER EXCLUSIONS
  1. .S J=$$PRIMPROV^APCLV(BUDVSIT,"F")
  1. .I J,$D(^BUDHSITE(BUDSITE,13,"B",J)) Q ;don't count visits with this class
  1. .S BUDVDATE=$$VD^APCLV(BUDVSIT)
  1. .S BUDPPD=$$PRIMPROV^APCLV(BUDVSIT,"D") ;primary provider discipline
  1. .I BUDPPD="" Q ;no discipline to check so can't count this visit
  1. MEDC .;NOW CHECK FOR MEDICAL CARE, CAN ONLY HAVE 1 PER LOCATION OF ENCOUNTER
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","MEDICAL CARE LINE NUMBERS",0))
  1. .I $E($$VAL^XBDIQ1(9000010,BUDVSIT,.06),1,3)="CHS",BUDPPD=15 S BUDLINE=2 G MEDC1
  1. .S BUDY=$O(^BUDHTFIV("C",BUDPPD,0)) I BUDY="" S BUDLINE=35 G MEDC1
  1. .S BUDLINE=$O(^BUDHTFIV("AA",BUDPPD,""))
  1. MEDC1 .S S=0
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"MEDCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a medical care visit on this date
  1. ..S ^TMP($J,"MEDCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. ..S BUDMEDV=BUDMEDV+1,BUDMEDVI=BUDVSIT
  1. .Q:S ;don't count this one, already counted one medical
  1. DENT .;NOW CHECK FOR DENTAL CARE
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","DENTAL LINE NUMBERS",0))
  1. .S S=0
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"DENTCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a DENTAL care visit on this date
  1. ..S ^TMP($J,"DENTCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S ;don't count this one, already counted one DENTAL
  1. MH .;NOW CHECK FOR MH CARE
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","MENTAL HEALTH LINE NUMBERS",0))
  1. .S P=$$PRIMPOV^APCLV(BUDVSIT,"C")
  1. .I $E(P,1,3)=303!($E(P,1,3)="304")!($E(P,1,3)="305") G SUB
  1. .S S=0
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"MHCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a MH care visit on this date
  1. ..S ^TMP($J,"MHCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S ;don't count this one, already counted one MH
  1. SUB .;
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","SUBSTANCE LINE NUMBERS",0))
  1. .S S=0
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"SUBCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a SUB care visit on this date
  1. ..S ^TMP($J,"SUBCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S ;don't count this one, already counted one SUBSTANCE
  1. VISION .;
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","VISION LINE NUMBERS",0))
  1. .S S=0
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"VISIONCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a VISION care visit on this date
  1. ..S ^TMP($J,"VISIONCARE",DFN,BUDVDATE,BUDVLOC,BUDTIEN)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S ;don't count this one, already counted one VISION
  1. OTH .;can have only 1 in each category
  1. .S BUDTIEN=$O(^BUDHTFIV("B",22,0))
  1. .S S=0
  1. .I $D(^BUDHTFIV(BUDTIEN,11,"B",BUDPPD)) D
  1. ..S D=$P($G(^TMP($J,"OTHSERV",DFN,BUDVDATE,BUDVLOC,BUDPPD)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q
  1. ..S ^TMP($J,"OTHSERV",DFN,BUDVDATE,BUDVLOC,BUDPPD)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S
  1. ENAB .;NOW CHECK FOR ENABLING
  1. .S S=0
  1. .S BUDTIEN=$O(^BUDHCNTL("B","ENABLING LINE NUMBERS",0))
  1. .I $D(^BUDHCNTL(BUDTIEN,11,"B",BUDLINE)) D
  1. ..S D=$P($G(^TMP($J,"ENABCARE",DFN,BUDVDATE,BUDVLOC,BUDPPD)),U,1)
  1. ..I D]"",D'>$P(^AUPNVSIT(BUDVSIT,0),U) S S=1 Q ;already have a ENABLING care visit on this date
  1. ..S ^TMP($J,"ENABCARE",DFN,BUDVDATE,BUDVLOC,BUDPPD)=$P(^AUPNVSIT(BUDVSIT,0),U)_U_BUDVSIT
  1. .Q:S ;don't count this one, already counted onE ENABLING
  1. SET .;
  1. .S ^TMP($J,"VISITSTABLE5",BUDVSIT)="" ;USED IN TABLE 5
  1. ;NOW TABLE 6A
  1. A6 S BUDX=0 F S BUDX=$O(^TMP($J,"VISITS",BUDX)) Q:BUDX'=+BUDX S BUDVSIT=$P(^TMP($J,"VISITS",BUDX),U,5) D
  1. .Q:'$D(^AUPNVSIT(BUDVSIT,0))
  1. .Q:'$P(^AUPNVSIT(BUDVSIT,0),U,9) ;0 dependent entries, not a visit
  1. .Q:$P(^AUPNVSIT(BUDVSIT,0),U,11) ;deleted visit
  1. .S BUDVLOC=$P(^AUPNVSIT(BUDVSIT,0),U,6) ;must be to a location in the site parameter file
  1. .Q:BUDVLOC=""
  1. .Q:'$D(^BUDHSITE(BUDSITE,11,BUDVLOC)) ;not valid location
  1. .Q:"AHSORMI"'[$P(^AUPNVSIT(BUDVSIT,0),U,7) ;ignore cr/telephone/events
  1. .S BUDCLINC=$$CLINIC^APCLV(BUDVSIT,"C")
  1. .S BUDTIEN=$O(^BUDHCNTL("B","TABLE 6A CLINIC EXCLUSIONS",0))
  1. .I BUDCLINC]"",$D(^BUDHCNTL(BUDTIEN,11,"B",BUDCLINC)) Q ;don't count excluded clinics
  1. .;S BUDP=$$PRIMPROV^APCLV(BUDVSIT) Q:'BUDP ;no primary provider - WHAT ABOUT ORPHANS FOR LAB/RAD/IMM
  1. .;COUNT ONLY 1 INPATIENT VISIT PER DAY
  1. .I $P(^AUPNVSIT(BUDVSIT,0),U,7)="H",$D(^TMP($J,"H",DFN,$$VD^APCLV(BUDVSIT))) Q
  1. .I $P(^AUPNVSIT(BUDVSIT,0),U,7)="H" S ^TMP($J,"H",DFN,$$VD^APCLV(BUDVSIT))=""
  1. .S ^TMP($J,"VISITSTABLE6A",BUDVSIT)=""
  1. ;now get all mamms and paps in date range and count as orphans if at this facility and no mam on that date in pcc
  1. S T="MAMMOGRAM SCREENING",T=$O(^BWPN("B",T,0))
  1. S T1="MAMMOGRAM DX BILAT",T1=$O(^BWPN("B",T1,0))
  1. S T2="MAMMOGRAM DX UNILAT",T2=$O(^BWPN("B",T2,0))
  1. D
  1. .S (G,V)=0 F S V=$O(^BWPCD("C",DFN,V)) Q:V="" D
  1. ..Q:'$D(^BWPCD(V,0))
  1. ..S D=$P(^BWPCD(V,0),U,12)
  1. ..S J=$P(^BWPCD(V,0),U,4) I J=T!(J=T1)!(J=T2) D Q
  1. ...Q:D<BUDBD
  1. ...Q:D>BUDED
  1. ...S L=$P(^BWPCD(V,0),U,10)
  1. ...Q:L=""
  1. ...Q:'$D(^BUDHSITE(BUDSITE,11,L)) ;not valid location
  1. ...Q:$P($G(^BWPCD(V,"PCC")),U,1)]"" ;already in pcc
  1. ...S ^TMP($J,"MAMMS",V)="WH "_$$VAL^XBDIQ1(9002086.1,V,.04)_U_$$FMTE^XLFDT(D)
  1. .Q
  1. S T="PAP SMEAR",T=$O(^BWPN("B",T,0))
  1. D
  1. .S (G,V)=0 F S V=$O(^BWPCD("C",DFN,V)) Q:V="" D
  1. ..Q:'$D(^BWPCD(V,0))
  1. ..S D=$P(^BWPCD(V,0),U,12)
  1. ..S J=$P(^BWPCD(V,0),U,4) I J=T D Q
  1. ...Q:D<BUDBD
  1. ...Q:D>BUDED
  1. ...S L=$P(^BWPCD(V,0),U,10)
  1. ...Q:L=""
  1. ...Q:'$D(^BUDHSITE(BUDSITE,11,L)) ;not valid location
  1. ...Q:$P($G(^BWPCD(V,"PCC")),U,1)]"" ;already in pcc
  1. ...S ^TMP($J,"PAPS",V)="WH "_$$VAL^XBDIQ1(9002086.1,V,.04)_U_$$FMTE^XLFDT(D)
  1. .Q
  1. Q
  1. TZH ;EP
  1. Q:BUDROT="D"
  1. G:'BUDGPG TZH1
  1. K DIR I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BUDQUIT=1 Q
  1. TZH1 ;
  1. W:$D(IOF) @IOF S BUDGPG=BUDGPG+1
  1. W !,$$CTR("***** SENSITIVE INFORMATION *****",IOM)
  1. W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?55,"Section "_BUDSCTC_" of "_BUDTSCTC_", Page "_BUDGPG,!
  1. W !,$$CTR("*** RPMS Uniform Data System (UDS) "_$$VER^BUDHBAN()_" ***",80)
  1. W !,$$CTR("Patient List: Patient by Zip Code/Insurance",80),!
  1. W $$CTR($P(^DIC(4,BUDSITE,0),U),80),!
  1. S X="Reporting Period: "_$$FMTE^XLFDT(BUDBD)_" to "_$$FMTE^XLFDT(BUDED) W $$CTR(X,80),!
  1. S X="Population: "_$S($G(BUDBEN)=1:"Indian/Alaskan Native (Classification 01)",$G(BUDBEN)=2:"Not Indian Alaskan/Native (Not Classification 01)",$G(BUDBEN)=3:"All (both Indian/Alaskan Natives and Non 01)",BUDBEN=4:"Homeless",1:"")
  1. W $$CTR(X,80),!
  1. W $TR($J("",80)," ","-")
  1. I BUDP=0 W !,"List of all patients with one or more visits during the calendar year."
  1. I BUDP=0 W !,"Zip code is from patient registration."
  1. I BUDP=0 W !!,"NOTE: Patients with a zip code included in the Other Zip Codes category"
  1. I BUDP=0 W !,"have their zip code value followed by a ""","*",""" (e.g. 87015*)."
  1. W !!,"PATIENT NAME",?24,"HRN",?36,"COMMUNITY",?50,"SEX",?55,"ZIP CODE",?65,"INS"
  1. W !?5,"VISIT DATE",?25,"PROV TYPE",?41,"SRV",?45,"CLINIC",?62,"LOCATION"
  1. S BUDP=1
  1. W !,$TR($J("",80)," ","-")
  1. Q
  1. CTR(X,Y) ;EP
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;
  1. WDEL ;EP - write out delimited file 9d
  1. G WDEL^BUDHRPTQ
  1. LOTE(P,V) ;
  1. ;if prim lang=other than english
  1. ;interpreter = yes AND
  1. ;preferred = other than english
  1. NEW X,%,Y,D,L,PL,IR,RL
  1. S D=$$VD^APCLV(V)
  1. S %=0,X=0 S (Y,L,PL,IR,RL)=""
  1. F S X=$O(^AUPNPAT(P,86,"B",X)) Q:X'=+X!(X>D) S Y=0 F S Y=$O(^AUPNPAT(P,86,"B",X,Y)) Q:Y'=+Y S L=Y ;get last one
  1. I 'L Q 0 ;no data recorded
  1. I $P($G(^AUPNPAT(P,86,L,0)),U,3)'="Y" Q 0 ;INTERPRETER NOT REQUIRED SO DON'T COUNT
  1. S PL=$P($G(^AUPNPAT(P,86,L,0)),U,1)
  1. I 'PL Q 0 ;NO PRIM LANG
  1. I $$VAL^XBDIQ1(9999999.99,PL,.01)="ENGLISH" Q 0
  1. S PL=$P($G(^AUPNPAT(P,86,L,0)),U,4)
  1. I 'PL Q 0 ;NO PREF LANG
  1. I $$VAL^XBDIQ1(9999999.99,PL,.04)="ENGLISH" Q 0
  1. Q 1
  1. TZHD ;EP
  1. D S("***** SENSITIVE INFORMATION *****")
  1. D S($P(^VA(200,DUZ,0),U,2)_" "_$$FMTE^XLFDT(DT))
  1. D S("*** RPMS Uniform Data System (UDS) "_$$VER^BUDHBAN()_" ***")
  1. D S("Patient List: Patient by Zip Code/Insurance")
  1. D S($P(^DIC(4,BUDSITE,0),U))
  1. S X="Reporting Period: "_$$FMTE^XLFDT(BUDBD)_" to "_$$FMTE^XLFDT(BUDED) D S(X)
  1. S X="Population: "_$S($G(BUDBEN)=1:"Indian/Alaskan Native (Classification 01)",$G(BUDBEN)=2:"Not Indian Alaskan/Native (Not Classification 01)",$G(BUDBEN)=3:"All (both Indian/Alaskan Natives and Non 01)",BUDBEN=4:"Homeless",1:"") D S(X)
  1. D S(" ")
  1. D S("List of all patients with one or more visits during the calendar year.")
  1. D S("Zip code is from patient registration.")
  1. D S("NOTE: Patients with a zip code included in the Other Zip Codes category")
  1. S X="have their zip code value followed by a '*' (e.g. 87015*)." D S(X)
  1. D S(" "),S("PATIENT NAME^HRN^COMMUNITY^SEX^ZIP CODE^INSURANCE^VISIT DATE^PROV TYPE^SRV^CLINIC^LOCATION")
  1. Q
  1. S(V) ;
  1. S BUDDECNT=BUDDECNT+1
  1. S ^TMP($J,"BUDDEL",BUDDECNT)=$G(V)
  1. Q
  1. SAVEDEL ;EP
  1. I BUDDELT="S" D SCREEN Q
  1. ;call xbgsave to create output file
  1. S XBGL="BUDDATA"
  1. L +^BUDDATA:300 E W:'$D(ZTQUEUED) "Unable to lock global" Q
  1. K ^TMP($J,"SUMMARYDEL")
  1. K ^BUDDATA ;global for saving
  1. D COVPAGED^BUDHUTL1
  1. S C=C+1 S ^BUDDATA(C)=" "
  1. S X=0 F S X=$O(^TMP($J,"BUDDEL",X)) Q:X'=+X S C=C+1 S ^BUDDATA(C)=^TMP($J,"BUDDEL",X)
  1. S C=C+2 S ^BUDDATA(C)="***** END OF REPORT *****"
  1. D
  1. .S XBFLT=1,XBFN=BUDDELF_".txt",XBMED="F",XBTLE="UDS DELIMITED OUTPUT",XBQ="N",XBF=0
  1. .D ^XBGSAVE
  1. .K XBFLT,XBFN,XBMED,XBTLE,XBE,XBF
  1. L -^BUDDATA
  1. K ^BUDDATA ;export global
  1. K ^TMP($J,"BUDDEL")
  1. Q
  1. ;
  1. SCREEN ;
  1. D COVPAGEP^BUDHUTL1
  1. W !," "
  1. S X=0 F S X=$O(^TMP($J,"BUDDEL",X)) Q:X'=+X W !,^TMP($J,"BUDDEL",X)
  1. W !!,"***** END OF REPORT *****",!
  1. Q
  1. T6DH ;EP
  1. D S(""),S(""),S("")
  1. D S("***** SENSITIVE INFORMATION *****")
  1. D S($P(^VA(200,DUZ,0),U,2)_" "_$$FMTE^XLFDT(DT))
  1. D S("*** RPMS Uniform Data System (UDS) "_$$VER^BUDHBAN()_" ***")
  1. D S("Patient List for Table 6A, By Diagnosis Category")
  1. D S($P(^DIC(4,BUDSITE,0),U))
  1. S X="Reporting Period: "_$$FMTE^XLFDT(BUDBD)_" to "_$$FMTE^XLFDT(BUDED) D S(X)
  1. S X="Population: "_$S($G(BUDBEN)=1:"Indian/Alaskan Native (Classification 01)",$G(BUDBEN)=2:"Not Indian Alaskan/Native (Not Classification 01)",$G(BUDBEN)=3:"All (both Indian/Alaskan Natives and Non 01)",BUDBEN=4:"Homeless",1:"") D S(X)
  1. D S(" ")
  1. D S("List of all patients, sorted by diagnosis and tests/screening")
  1. D S("categories. Displays community, gender, age and visit data, and codes.")
  1. D S("* (R) - denotes the value was obtained from the Race field")
  1. D S(" (C) - denotes the value was obtained from the Classification/Beneficiary field")
  1. ;D S("Age is calculated as of June 30.")
  1. D S("")
  1. D S("PATIENT NAME^HRN^COMMUNITY^SEX^AGE^RACE*^VISIT DATE^VALUE^SRV^CLINIC^LOCATION")
  1. Q