BGP9NPLP ; IHS/CMI/LAB - IHS gpra print 30 Jun 2008 5:58 PM ;
;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
;
NPL ;
Q:$G(BGPAREAA)
S BGPQUIT="",BGPGPG=0
S BGPINDN=0,BGPCOUNT=0 F S BGPINDN=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN)) Q:BGPINDN'=+BGPINDN!(BGPQUIT) D NPL1
Q
NPL1 ;EP
Q:$G(BGPAREAA)
S BGPO=0 F S BGPO=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO)) Q:BGPO'=+BGPO!(BGPQUIT) D NPL11
Q
NPL11 ;
S BGPL=0 F S BGPL=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL)) Q:BGPL'=+BGPL!(BGPQUIT) D
.S BGPINDN=$P(^BGPNPLN(BGPL,0),U)
.S BGPCOUNT=0,BGPPCNT=0
.D HEADER Q:BGPQUIT
.S BGPCNT=BGPINDL(BGPINDN,BGPL)
.I BGPCNT<11!(BGPLIST'="R") S BGPCNT=1 G GO
.I BGPCNT<100 S BGPCNT=BGPCNT\10 G GO
.S BGPCNT=10
GO .;
.D WTITLE ;W !,$P(^BGPINDN(BGPINDN,0),U,3)
.G NEXT
.W !,"Denominator(s):"
.S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,61,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPINDN(BGPINDN,61,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...;I $P(^BGPINDN(BGPINDN,61,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...I '$D(^BGPINDN(BGPINDN,61,BGPY,11,"B",BGPRTYPE)) Q ;not this report type
...S BGPZ=0 F S BGPZ=$O(^BGPINDN(BGPINDN,61,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT) D
....I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT
....W !,^BGPINDN(BGPINDN,61,BGPY,1,BGPZ,0)
....Q
...;W !
...Q
..Q
.I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT
.W !!,"Numerator(s):"
.S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,62,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPINDN(BGPINDN,62,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...;I $P(^BGPINDN(BGPINDN,62,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...I '$D(^BGPINDN(BGPINDN,62,BGPY,11,"B",BGPRTYPE)) Q ;not this report type
...S BGPZ=0 F S BGPZ=$O(^BGPINDN(BGPINDN,62,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT) D
....I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT
....W !,^BGPINDN(BGPINDN,62,BGPY,1,BGPZ,0)
....Q
...Q
..Q
.S BGPNODE=11 I BGPRTYPE=1,$O(^BGPINDN(BGPINDN,54,0)) S BGPNODE=54
.W !!,"Logic" S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,BGPNODE,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
..W !,^BGPINDN(BGPINDN,BGPNODE,BGPX,0)
.W !!,"Performance Measure Description" S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,51,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
..W !,^BGPINDN(BGPINDN,51,BGPX,0)
.I $O(^BGPINDN(BGPINDN,52,0)) W !,"Past Performance and/or Target" S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,52,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
..W !,^BGPINDN(BGPINDN,52,BGPX,0)
.I $O(^BGPINDN(BGPINDN,55,0)) W !,"Source" S BGPX=0 F S BGPX=$O(^BGPINDN(BGPINDN,55,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
..W !,^BGPINDN(BGPINDN,55,BGPX,0)
NEXT .;
.S BGPX=0 F S BGPX=$O(^BGPNPLN(BGPL,11,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT
..W !,^BGPNPLN(BGPL,11,BGPX,0)
.D H1
.S BGPCOM="" F S BGPCOM=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM)) Q:BGPCOM=""!(BGPQUIT) D
..S BGPSEX="" F S BGPSEX=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX)) Q:BGPSEX=""!(BGPQUIT) D
...S BGPAGE="" F S BGPAGE=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE)) Q:BGPAGE=""!(BGPQUIT) D
....S DFN=0 F S DFN=$O(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN)) Q:DFN'=+DFN!(BGPQUIT) S BGPCOUNT=BGPCOUNT+1 D PRINTL
....Q
...Q
..Q
.I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT
.W !!,"Total # of patients on list: ",+$G(BGPPCNT),!
Q
WTITLE ;EP - write title line
NEW T,X,Y,S
S T=$P(^BGPINDN(BGPINDN,0),U,3)
I $L(T)<81 W !,T,! Q
F X=$E(T,1,80)
S S=""
F Y=80:-1:1 Q:S S I=$E(X,Y) I I=" " S S=Y
W !,$E(T,1,S)
W !,$E(T,(S+1),$L(T)),!
Q
;
PRINTL ;print one line
Q:(BGPCOUNT#BGPCNT)
I $Y>(BGPIOSL-3) D HEADER Q:BGPQUIT D
.S X=0 F S X=$O(^BGPNPLN(BGPL,11,X)) Q:X'=+X W !,^BGPNPLN(BGPL,11,X,0)
.D H1
S BGPPCNT=BGPPCNT+1
W !,$E($P(^DPT(DFN,0),U),1,22),?24,$$HRN^AUPNPAT(DFN,DUZ(2)),?31,$E(BGPCOM,1,14),?46,BGPSEX,?49,BGPAGE
W ?53,$P(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN),"|||",1),?65,$P(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN),"|||",2)
Q
;
G:'BGPGPG HEADER1
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 BGPQUIT=1 Q
W:$D(IOF) @IOF S BGPGPG=BGPGPG+1
I $G(BGPGUI) W "ZZZZZZZ",! ;maw
W !,"***** CONFIDENTIAL PATIENT INFORMATION, COVERED BY THE PRIVACY ACT *****"
W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BGPGPG,!
I BGPRTYPE=1 W !,$$CTR("*** IHS 2009 GPRA Performance & PART Patient List ***",80),!
I BGPRTYPE=7 W !,$$CTR("*** IHS 2009 Other National Measures Patient List ***",80),!
W $$CTR($$RPTVER^BGP9BAN,80),!
W $$CTR($P(^DIC(4,DUZ(2),0),U),80),!
S X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED) W $$CTR(X,80),!
W $$CTR($S(BGPLIST="A":"All Patients",BGPLIST="R":"Random Patient List",1:"Patient List by Provider: "_BGPLPROV),80),!
W !,$TR($J("",80)," ","-")
Q
H1 ;
W !,"UP=User Pop; AC=Active Clinical; AD=Active Diabetic; AAD=Active Adult Diabetic",!,"PREG=Pregnant Female; IMM=Active IMM Pkg Pt; IHD=Active Ischemic Heart Disease",!
W !,"PATIENT NAME",?24,"HRN",?31,"COMMUNITY",?45,"SEX",?49,"AGE",?53,"DENOMINATOR",?65,"NUMERATOR"
W !,$TR($J("",80)," ","-")
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")
;----------
BGP9NPLP ; IHS/CMI/LAB - IHS gpra print 30 Jun 2008 5:58 PM ;
+1 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
+2 ;
NPL ;
+1 IF $GET(BGPAREAA)
QUIT
+2 SET BGPQUIT=""
SET BGPGPG=0
+3 SET BGPINDN=0
SET BGPCOUNT=0
FOR
SET BGPINDN=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN))
IF BGPINDN'=+BGPINDN!(BGPQUIT)
QUIT
DO NPL1
+4 QUIT
NPL1 ;EP
+1 IF $GET(BGPAREAA)
QUIT
+2 SET BGPO=0
FOR
SET BGPO=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO))
IF BGPO'=+BGPO!(BGPQUIT)
QUIT
DO NPL11
+3 QUIT
NPL11 ;
+1 SET BGPL=0
FOR
SET BGPL=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL))
IF BGPL'=+BGPL!(BGPQUIT)
QUIT
Begin DoDot:1
+2 SET BGPINDN=$PIECE(^BGPNPLN(BGPL,0),U)
+3 SET BGPCOUNT=0
SET BGPPCNT=0
+4 DO HEADER
IF BGPQUIT
QUIT
+5 SET BGPCNT=BGPINDL(BGPINDN,BGPL)
+6 IF BGPCNT<11!(BGPLIST'="R")
SET BGPCNT=1
GOTO GO
+7 IF BGPCNT<100
SET BGPCNT=BGPCNT\10
GOTO GO
+8 SET BGPCNT=10
GO ;
+1 ;W !,$P(^BGPINDN(BGPINDN,0),U,3)
DO WTITLE
+2 GOTO NEXT
+3 WRITE !,"Denominator(s):"
+4 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,61,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+5 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPINDN(BGPINDN,61,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+6 ;I $P(^BGPINDN(BGPINDN,61,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
+7 ;not this report type
IF '$DATA(^BGPINDN(BGPINDN,61,BGPY,11,"B",BGPRTYPE))
QUIT
+8 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPINDN(BGPINDN,61,BGPY,1,BGPZ))
IF BGPZ'=+BGPZ!(BGPQUIT)
QUIT
Begin DoDot:4
+9 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
+10 WRITE !,^BGPINDN(BGPINDN,61,BGPY,1,BGPZ,0)
+11 QUIT
End DoDot:4
+12 ;W !
+13 QUIT
End DoDot:3
+14 QUIT
End DoDot:2
+15 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
+16 WRITE !!,"Numerator(s):"
+17 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,62,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+18 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPINDN(BGPINDN,62,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+19 ;I $P(^BGPINDN(BGPINDN,62,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
+20 ;not this report type
IF '$DATA(^BGPINDN(BGPINDN,62,BGPY,11,"B",BGPRTYPE))
QUIT
+21 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPINDN(BGPINDN,62,BGPY,1,BGPZ))
IF BGPZ'=+BGPZ!(BGPQUIT)
QUIT
Begin DoDot:4
+22 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
+23 WRITE !,^BGPINDN(BGPINDN,62,BGPY,1,BGPZ,0)
+24 QUIT
End DoDot:4
+25 QUIT
End DoDot:3
+26 QUIT
End DoDot:2
+27 SET BGPNODE=11
IF BGPRTYPE=1
IF $ORDER(^BGPINDN(BGPINDN,54,0))
SET BGPNODE=54
+28 WRITE !!,"Logic"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,BGPNODE,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+29 IF $Y>(BGPIOSL-3)
DO HEADER^BGP9DPH
IF BGPQUIT
QUIT
+30 WRITE !,^BGPINDN(BGPINDN,BGPNODE,BGPX,0)
End DoDot:2
+31 WRITE !!,"Performance Measure Description"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,51,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+32 IF $Y>(BGPIOSL-3)
DO HEADER^BGP9DPH
IF BGPQUIT
QUIT
+33 WRITE !,^BGPINDN(BGPINDN,51,BGPX,0)
End DoDot:2
+34 IF $ORDER(^BGPINDN(BGPINDN,52,0))
WRITE !,"Past Performance and/or Target"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,52,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+35 IF $Y>(BGPIOSL-3)
DO HEADER^BGP9DPH
IF BGPQUIT
QUIT
+36 WRITE !,^BGPINDN(BGPINDN,52,BGPX,0)
End DoDot:2
+37 IF $ORDER(^BGPINDN(BGPINDN,55,0))
WRITE !,"Source"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPINDN(BGPINDN,55,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+38 IF $Y>(BGPIOSL-3)
DO HEADER^BGP9DPH
IF BGPQUIT
QUIT
+39 WRITE !,^BGPINDN(BGPINDN,55,BGPX,0)
End DoDot:2
NEXT ;
+1 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPNPLN(BGPL,11,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+2 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
+3 WRITE !,^BGPNPLN(BGPL,11,BGPX,0)
End DoDot:2
+4 DO H1
+5 SET BGPCOM=""
FOR
SET BGPCOM=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM))
IF BGPCOM=""!(BGPQUIT)
QUIT
Begin DoDot:2
+6 SET BGPSEX=""
FOR
SET BGPSEX=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX))
IF BGPSEX=""!(BGPQUIT)
QUIT
Begin DoDot:3
+7 SET BGPAGE=""
FOR
SET BGPAGE=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE))
IF BGPAGE=""!(BGPQUIT)
QUIT
Begin DoDot:4
+8 SET DFN=0
FOR
SET DFN=$ORDER(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN))
IF DFN'=+DFN!(BGPQUIT)
QUIT
SET BGPCOUNT=BGPCOUNT+1
DO PRINTL
+9 QUIT
End DoDot:4
+10 QUIT
End DoDot:3
+11 QUIT
End DoDot:2
+12 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
+13 WRITE !!,"Total # of patients on list: ",+$GET(BGPPCNT),!
End DoDot:1
+14 QUIT
WTITLE ;EP - write title line
+1 NEW T,X,Y,S
+2 SET T=$PIECE(^BGPINDN(BGPINDN,0),U,3)
+3 IF $LENGTH(T)<81
WRITE !,T,!
QUIT
+4 FOR X=$EXTRACT(T,1,80)
+5 SET S=""
+6 FOR Y=80:-1:1
IF S
QUIT
SET I=$EXTRACT(X,Y)
IF I=" "
SET S=Y
+7 WRITE !,$EXTRACT(T,1,S)
+8 WRITE !,$EXTRACT(T,(S+1),$LENGTH(T)),!
+9 QUIT
+10 ;
PRINTL ;print one line
+1 IF (BGPCOUNT#BGPCNT)
QUIT
+2 IF $Y>(BGPIOSL-3)
DO HEADER
IF BGPQUIT
QUIT
Begin DoDot:1
+3 SET X=0
FOR
SET X=$ORDER(^BGPNPLN(BGPL,11,X))
IF X'=+X
QUIT
WRITE !,^BGPNPLN(BGPL,11,X,0)
+4 DO H1
End DoDot:1
+5 SET BGPPCNT=BGPPCNT+1
+6 WRITE !,$EXTRACT($PIECE(^DPT(DFN,0),U),1,22),?24,$$HRN^AUPNPAT(DFN,DUZ(2)),?31,$EXTRACT(BGPCOM,1,14),?46,BGPSEX,?49,BGPAGE
+7 WRITE ?53,$PIECE(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN),"|||",1),?65,$PIECE(^XTMP("BGP9DNP",BGPJ,BGPH,"LIST",BGPINDN,BGPO,BGPL,BGPCOM,BGPSEX,BGPAGE,DFN),"|||",2)
+8 QUIT
+9 ;
+1 IF 'BGPGPG
GOTO HEADER1
+2 KILL DIR
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
IF '$DATA(ZTQUEUED)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BGPQUIT=1
QUIT
+1 IF $DATA(IOF)
WRITE @IOF
SET BGPGPG=BGPGPG+1
+2 ;maw
IF $GET(BGPGUI)
WRITE "ZZZZZZZ",!
+3 WRITE !,"***** CONFIDENTIAL PATIENT INFORMATION, COVERED BY THE PRIVACY ACT *****"
+4 WRITE !?3,$PIECE(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BGPGPG,!
+5 IF BGPRTYPE=1
WRITE !,$$CTR("*** IHS 2009 GPRA Performance & PART Patient List ***",80),!
+6 IF BGPRTYPE=7
WRITE !,$$CTR("*** IHS 2009 Other National Measures Patient List ***",80),!
+7 WRITE $$CTR($$RPTVER^BGP9BAN,80),!
+8 WRITE $$CTR($PIECE(^DIC(4,DUZ(2),0),U),80),!
+9 SET X="Report Period: "_$$FMTE^XLFDT(BGPBD)_" to "_$$FMTE^XLFDT(BGPED)
WRITE $$CTR(X,80),!
+10 WRITE $$CTR($SELECT(BGPLIST="A":"All Patients",BGPLIST="R":"Random Patient List",1:"Patient List by Provider: "_BGPLPROV),80),!
+11 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+12 QUIT
H1 ;
+1 WRITE !,"UP=User Pop; AC=Active Clinical; AD=Active Diabetic; AAD=Active Adult Diabetic",!,"PREG=Pregnant Female; IMM=Active IMM Pkg Pt; IHD=Active Ischemic Heart Disease",!
+2 WRITE !,"PATIENT NAME",?24,"HRN",?31,"COMMUNITY",?45,"SEX",?49,"AGE",?53,"DENOMINATOR",?65,"NUMERATOR"
+3 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+4 QUIT
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 ;----------