BDMDD1Q ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ; 22 Feb 2014 3:43 PM
;;2.0;DIABETES MANAGEMENT SYSTEM;**9**;JUN 14, 2007;Build 78
;
;
SDPI ;EP
;print aggregate audit
;
;
PRINT ;
;S BDMPG=0
S BDMQUIT=0
D HEADER
D PRINT1 ;print each indicator
D EXIT
Q
;
PRINT1 ;
I BDMNOGO D
.W !!,"*** Please NOTE: ",BDMNOGO," Patients were not included in this cumulative audit",!,"because their date of onset was after the audit date.",!
W !!,$P(BDMCUML(10),U,1)
W !?5,$P(BDMCUML(10,1),U)
W !?5,$P(BDMCUML(10,2),U)
W !?5,$P(BDMCUML(10,3),U),?49,$$C($P(BDMCUML(10,3),U,2)),?61,$$C($P(BDMCUML(10,3),U,3)),?73,$$P($P(BDMCUML(10,3),U,3),$P(BDMCUML(10,3),U,2))
W !?5,$P(BDMCUML(10,4),U)
W !?5,$P(BDMCUML(10,5),U),?49,$$C($P(BDMCUML(10,5),U,2)),?61,$$C($P(BDMCUML(10,5),U,3)),?73,$$P($P(BDMCUML(10,5),U,3),$P(BDMCUML(10,5),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(20),U)
W !?5,$P(BDMCUML(20,1),U),?49,$$C($P(BDMCUML(20,1),U,2)),?61,$$C($P(BDMCUML(20,1),U,3)),?73,$$P($P(BDMCUML(20,1),U,3),$P(BDMCUML(20,1),U,2))
W !?5,$P(BDMCUML(20,2),U),?49,$$C($P(BDMCUML(20,2),U,2)),?61,$$C($P(BDMCUML(20,2),U,3)),?73,$$P($P(BDMCUML(20,2),U,3),$P(BDMCUML(20,2),U,2))
W !?5,$P(BDMCUML(20,3),U),?49,$$C($P(BDMCUML(20,3),U,2)),?61,$$C($P(BDMCUML(20,3),U,3)),?73,$$P($P(BDMCUML(20,3),U,3),$P(BDMCUML(20,3),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(30),U)
W !?5,$P(BDMCUML(30,1),U)
W !?5,$P(BDMCUML(30,2),U),?49,$$C($P(BDMCUML(30,2),U,2)),?61,$$C($P(BDMCUML(30,2),U,3)),?73,$$P($P(BDMCUML(30,2),U,3),$P(BDMCUML(30,2),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(40),U)
W !?5,$P(BDMCUML(40,1),U),?49,$$C($P(BDMCUML(40,1),U,2)),?61,$$C($P(BDMCUML(40,1),U,3)),?73,$$P($P(BDMCUML(40,1),U,3),$P(BDMCUML(40,1),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(50),U)
W !?5,$P(BDMCUML(50,1),U),?49,$$C($P(BDMCUML(50,1),U,2)),?61,$$C($P(BDMCUML(50,1),U,3)),?73,$$P($P(BDMCUML(50,1),U,3),$P(BDMCUML(50,1),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(60),U)
W !?5,$P(BDMCUML(60,1),U),?49,$$C($P(BDMCUML(60,1),U,2)),?61,$$C($P(BDMCUML(60,1),U,3)),?73,$$P($P(BDMCUML(60,1),U,3),$P(BDMCUML(60,1),U,2))
W !?5,$P(BDMCUML(60,2),U),?49,$$C($P(BDMCUML(60,2),U,2)),?61,$$C($P(BDMCUML(60,2),U,3)),?73,$$P($P(BDMCUML(60,2),U,3),$P(BDMCUML(60,2),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(70),U)
W !?5,$P(BDMCUML(70,1),U),?49,$$C($P(BDMCUML(70,1),U,2)),?61,$$C($P(BDMCUML(70,1),U,3)),?73,$$P($P(BDMCUML(70,1),U,3),$P(BDMCUML(70,1),U,2))
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(80),U)
W !?5,$P(BDMCUML(80,1),U)
W !?5,$P(BDMCUML(80,2),U),?49,$$C($P(BDMCUML(80,2),U,2)),?61,$$C($P(BDMCUML(80,2),U,3)),?73,$$P($P(BDMCUML(80,2),U,3),$P(BDMCUML(80,2),U,2))
W !?5,$P(BDMCUML(80,3),U),?49,$$C($P(BDMCUML(80,3),U,2)),?61,$$C($P(BDMCUML(80,3),U,3)),?73,$$P($P(BDMCUML(80,3),U,3),$P(BDMCUML(80,3),U,2))
W !?5,$P(BDMCUML(80,4),U)
W !?5,$P(BDMCUML(80,5),U),?49,$$C($P(BDMCUML(80,5),U,2)),?61,$$C($P(BDMCUML(80,5),U,3)),?73,$$P($P(BDMCUML(80,5),U,3),$P(BDMCUML(80,5),U,2))
I $Y>(BDMIOSL-9) D HEADER Q:BDMQUIT
W !!,$P(BDMCUML(90),U)
W !?5,$P(BDMCUML(90,1),U),?49,$$C($P(BDMCUML(90,1),U,2)),?61,$$C($P(BDMCUML(90,1),U,3)),?73,$$P($P(BDMCUML(90,1),U,3),$P(BDMCUML(90,1),U,2))
W !?5,$P(BDMCUML(90,2),U),?49,$$C($P(BDMCUML(90,2),U,2)),?61,$$C($P(BDMCUML(90,2),U,3)),?73,$$P($P(BDMCUML(90,2),U,3),$P(BDMCUML(90,2),U,2))
W !?5,$P(BDMCUML(90,3),U),?49,$$C($P(BDMCUML(90,3),U,2)),?61,$$C($P(BDMCUML(90,3),U,3)),?73,$$P($P(BDMCUML(90,3),U,3),$P(BDMCUML(90,3),U,2))
W !?5,$P(BDMCUML(90,4),U),?49,$$C($P(BDMCUML(90,4),U,2)),?61,$$C($P(BDMCUML(90,4),U,3)),?73,$$P($P(BDMCUML(90,4),U,3),$P(BDMCUML(90,4),U,2))
W !?5,$P(BDMCUML(90,5),U)
W !?5,$P(BDMCUML(90,6),U),?49,$$C($P(BDMCUML(90,6),U,2)),?61,$$C($P(BDMCUML(90,6),U,3)),?73,$$P($P(BDMCUML(90,6),U,3),$P(BDMCUML(90,6),U,2))
I $Y>(BDMIOSL-6) D HEADER Q:BDMQUIT
W !!,"* Selected patients could be people with or without diabetes, the target "
W !,"group for SDPI activities, or whatever group of people is relevant for "
W !,"reporting purposes."
W !,"**This item is only reported for patients without an active diagnosis "
W !,"of depression, not all selected patients.",!
Q
EXIT ;
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO",DIR("A")="End of report. Press ENTER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q
CALC(N,O) ;ENTRY POINT
;N is new
;O is old
NEW Z
I O=0!(N=0) Q "**"
NEW X,X2,X3
S X=N,X2=1,X3=0 D COMMA^%DTC S N=X
S X=O,X2=1,X3=0 D COMMA^%DTC S O=X
S Z=(((N-O)/O)*100),Z=$FN(Z,"+,",1)
Q Z
P(D,N) ;return %
I 'D Q ""
I 'N Q " 0%"
NEW X S X=N/D,X=X*100,X=$J(X,3,0)
Q X_"%"
C(X,X2,X3) ;
I '$G(X2) S X2=0
I '$G(X3) S X3=6
D COMMA^%DTC
Q X
G:'BDMPG HEADER1
W !
K DIR I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BDMQUIT=1 Q
W:$D(IOF) @IOF S BDMPG=BDMPG+1
I $G(BDMGUI),BDMPG'=1 W !,"ZZZZZZZ"
I $G(BDMGUI) W !!
W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BDMPG,!
W !,$$CTR("IHS DIABETES CARE AND OUTCOMES AUDIT REPORT - RPMS AUDIT",80),!
N BDMDHDR
S BDMDHDR="SDPI Required Key Measures Report [2015 Version] ("_$$DATE^BDMS9B1(BDMBDAT)_" to "_$$DATE^BDMS9B1(BDMADAT)_")"
W $$CTR(BDMDHDR,80),!
;W $$CTR("AUDIT REPORT FOR 2016 (Audit Period "_$$DATE^BDMS9B1(BDMBDAT)_" to "_$$DATE^BDMS9B1(BDMADAT)_")"),!
S X="Facility: "_$P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U) W $$CTR(X,80),!
;S X="Annual Audit/SDPI Reporting" W !,$$CTR(X,80),!
S X=$P(BDMCUML(10,3),U,3)_" patients were audited*" W !,$$CTR(X),!
W $TR($J("",80)," ","-"),!
W ?45,"# of ",?57,"#",?70,"Percent",!
W ?45,"Patients",?57,"Considered",!
W ?45,"(Numerator)",?57,"(Denominator)",!
Q
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
EOP ;EP - End of page.
Q:$E(IOST)'="C"
Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
NEW DIR
K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
S DIR(0)="E" D ^DIR
Q
;----------
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")
;----------
BDMDD1Q ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ; 22 Feb 2014 3:43 PM
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**9**;JUN 14, 2007;Build 78
+2 ;
+3 ;
SDPI ;EP
+1 ;print aggregate audit
+2 ;
+3 ;
PRINT ;
+1 ;S BDMPG=0
+2 SET BDMQUIT=0
+3 DO HEADER
+4 ;print each indicator
DO PRINT1
+5 DO EXIT
+6 QUIT
+7 ;
PRINT1 ;
+1 IF BDMNOGO
Begin DoDot:1
+2 WRITE !!,"*** Please NOTE: ",BDMNOGO," Patients were not included in this cumulative audit",!,"because their date of onset was after the audit date.",!
End DoDot:1
+3 WRITE !!,$PIECE(BDMCUML(10),U,1)
+4 WRITE !?5,$PIECE(BDMCUML(10,1),U)
+5 WRITE !?5,$PIECE(BDMCUML(10,2),U)
+6 WRITE !?5,$PIECE(BDMCUML(10,3),U),?49,$$C($PIECE(BDMCUML(10,3),U,2)),?61,$$C($PIECE(BDMCUML(10,3),U,3)),?73,$$P($PIECE(BDMCUML(10,3),U,3),$PIECE(BDMCUML(10,3),U,2))
+7 WRITE !?5,$PIECE(BDMCUML(10,4),U)
+8 WRITE !?5,$PIECE(BDMCUML(10,5),U),?49,$$C($PIECE(BDMCUML(10,5),U,2)),?61,$$C($PIECE(BDMCUML(10,5),U,3)),?73,$$P($PIECE(BDMCUML(10,5),U,3),$PIECE(BDMCUML(10,5),U,2))
+9 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+10 WRITE !!,$PIECE(BDMCUML(20),U)
+11 WRITE !?5,$PIECE(BDMCUML(20,1),U),?49,$$C($PIECE(BDMCUML(20,1),U,2)),?61,$$C($PIECE(BDMCUML(20,1),U,3)),?73,$$P($PIECE(BDMCUML(20,1),U,3),$PIECE(BDMCUML(20,1),U,2))
+12 WRITE !?5,$PIECE(BDMCUML(20,2),U),?49,$$C($PIECE(BDMCUML(20,2),U,2)),?61,$$C($PIECE(BDMCUML(20,2),U,3)),?73,$$P($PIECE(BDMCUML(20,2),U,3),$PIECE(BDMCUML(20,2),U,2))
+13 WRITE !?5,$PIECE(BDMCUML(20,3),U),?49,$$C($PIECE(BDMCUML(20,3),U,2)),?61,$$C($PIECE(BDMCUML(20,3),U,3)),?73,$$P($PIECE(BDMCUML(20,3),U,3),$PIECE(BDMCUML(20,3),U,2))
+14 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+15 WRITE !!,$PIECE(BDMCUML(30),U)
+16 WRITE !?5,$PIECE(BDMCUML(30,1),U)
+17 WRITE !?5,$PIECE(BDMCUML(30,2),U),?49,$$C($PIECE(BDMCUML(30,2),U,2)),?61,$$C($PIECE(BDMCUML(30,2),U,3)),?73,$$P($PIECE(BDMCUML(30,2),U,3),$PIECE(BDMCUML(30,2),U,2))
+18 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+19 WRITE !!,$PIECE(BDMCUML(40),U)
+20 WRITE !?5,$PIECE(BDMCUML(40,1),U),?49,$$C($PIECE(BDMCUML(40,1),U,2)),?61,$$C($PIECE(BDMCUML(40,1),U,3)),?73,$$P($PIECE(BDMCUML(40,1),U,3),$PIECE(BDMCUML(40,1),U,2))
+21 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+22 WRITE !!,$PIECE(BDMCUML(50),U)
+23 WRITE !?5,$PIECE(BDMCUML(50,1),U),?49,$$C($PIECE(BDMCUML(50,1),U,2)),?61,$$C($PIECE(BDMCUML(50,1),U,3)),?73,$$P($PIECE(BDMCUML(50,1),U,3),$PIECE(BDMCUML(50,1),U,2))
+24 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+25 WRITE !!,$PIECE(BDMCUML(60),U)
+26 WRITE !?5,$PIECE(BDMCUML(60,1),U),?49,$$C($PIECE(BDMCUML(60,1),U,2)),?61,$$C($PIECE(BDMCUML(60,1),U,3)),?73,$$P($PIECE(BDMCUML(60,1),U,3),$PIECE(BDMCUML(60,1),U,2))
+27 WRITE !?5,$PIECE(BDMCUML(60,2),U),?49,$$C($PIECE(BDMCUML(60,2),U,2)),?61,$$C($PIECE(BDMCUML(60,2),U,3)),?73,$$P($PIECE(BDMCUML(60,2),U,3),$PIECE(BDMCUML(60,2),U,2))
+28 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+29 WRITE !!,$PIECE(BDMCUML(70),U)
+30 WRITE !?5,$PIECE(BDMCUML(70,1),U),?49,$$C($PIECE(BDMCUML(70,1),U,2)),?61,$$C($PIECE(BDMCUML(70,1),U,3)),?73,$$P($PIECE(BDMCUML(70,1),U,3),$PIECE(BDMCUML(70,1),U,2))
+31 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+32 WRITE !!,$PIECE(BDMCUML(80),U)
+33 WRITE !?5,$PIECE(BDMCUML(80,1),U)
+34 WRITE !?5,$PIECE(BDMCUML(80,2),U),?49,$$C($PIECE(BDMCUML(80,2),U,2)),?61,$$C($PIECE(BDMCUML(80,2),U,3)),?73,$$P($PIECE(BDMCUML(80,2),U,3),$PIECE(BDMCUML(80,2),U,2))
+35 WRITE !?5,$PIECE(BDMCUML(80,3),U),?49,$$C($PIECE(BDMCUML(80,3),U,2)),?61,$$C($PIECE(BDMCUML(80,3),U,3)),?73,$$P($PIECE(BDMCUML(80,3),U,3),$PIECE(BDMCUML(80,3),U,2))
+36 WRITE !?5,$PIECE(BDMCUML(80,4),U)
+37 WRITE !?5,$PIECE(BDMCUML(80,5),U),?49,$$C($PIECE(BDMCUML(80,5),U,2)),?61,$$C($PIECE(BDMCUML(80,5),U,3)),?73,$$P($PIECE(BDMCUML(80,5),U,3),$PIECE(BDMCUML(80,5),U,2))
+38 IF $Y>(BDMIOSL-9)
DO HEADER
IF BDMQUIT
QUIT
+39 WRITE !!,$PIECE(BDMCUML(90),U)
+40 WRITE !?5,$PIECE(BDMCUML(90,1),U),?49,$$C($PIECE(BDMCUML(90,1),U,2)),?61,$$C($PIECE(BDMCUML(90,1),U,3)),?73,$$P($PIECE(BDMCUML(90,1),U,3),$PIECE(BDMCUML(90,1),U,2))
+41 WRITE !?5,$PIECE(BDMCUML(90,2),U),?49,$$C($PIECE(BDMCUML(90,2),U,2)),?61,$$C($PIECE(BDMCUML(90,2),U,3)),?73,$$P($PIECE(BDMCUML(90,2),U,3),$PIECE(BDMCUML(90,2),U,2))
+42 WRITE !?5,$PIECE(BDMCUML(90,3),U),?49,$$C($PIECE(BDMCUML(90,3),U,2)),?61,$$C($PIECE(BDMCUML(90,3),U,3)),?73,$$P($PIECE(BDMCUML(90,3),U,3),$PIECE(BDMCUML(90,3),U,2))
+43 WRITE !?5,$PIECE(BDMCUML(90,4),U),?49,$$C($PIECE(BDMCUML(90,4),U,2)),?61,$$C($PIECE(BDMCUML(90,4),U,3)),?73,$$P($PIECE(BDMCUML(90,4),U,3),$PIECE(BDMCUML(90,4),U,2))
+44 WRITE !?5,$PIECE(BDMCUML(90,5),U)
+45 WRITE !?5,$PIECE(BDMCUML(90,6),U),?49,$$C($PIECE(BDMCUML(90,6),U,2)),?61,$$C($PIECE(BDMCUML(90,6),U,3)),?73,$$P($PIECE(BDMCUML(90,6),U,3),$PIECE(BDMCUML(90,6),U,2))
+46 IF $Y>(BDMIOSL-6)
DO HEADER
IF BDMQUIT
QUIT
+47 WRITE !!,"* Selected patients could be people with or without diabetes, the target "
+48 WRITE !,"group for SDPI activities, or whatever group of people is relevant for "
+49 WRITE !,"reporting purposes."
+50 WRITE !,"**This item is only reported for patients without an active diagnosis "
+51 WRITE !,"of depression, not all selected patients.",!
+52 QUIT
EXIT ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
SET DIR("A")="End of report. Press ENTER"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 QUIT
CALC(N,O) ;ENTRY POINT
+1 ;N is new
+2 ;O is old
+3 NEW Z
+4 IF O=0!(N=0)
QUIT "**"
+5 NEW X,X2,X3
+6 SET X=N
SET X2=1
SET X3=0
DO COMMA^%DTC
SET N=X
+7 SET X=O
SET X2=1
SET X3=0
DO COMMA^%DTC
SET O=X
+8 SET Z=(((N-O)/O)*100)
SET Z=$FNUMBER(Z,"+,",1)
+9 QUIT Z
P(D,N) ;return %
+1 IF 'D
QUIT ""
+2 IF 'N
QUIT " 0%"
+3 NEW X
SET X=N/D
SET X=X*100
SET X=$JUSTIFY(X,3,0)
+4 QUIT X_"%"
C(X,X2,X3) ;
+1 IF '$GET(X2)
SET X2=0
+2 IF '$GET(X3)
SET X3=6
+3 DO COMMA^%DTC
+4 QUIT X
+1 IF 'BDMPG
GOTO HEADER1
+2 WRITE !
+3 KILL DIR
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BDMQUIT=1
QUIT
+1 IF $DATA(IOF)
WRITE @IOF
SET BDMPG=BDMPG+1
+2 IF $GET(BDMGUI)
IF BDMPG'=1
WRITE !,"ZZZZZZZ"
+3 IF $GET(BDMGUI)
WRITE !!
+4 WRITE !?3,$PIECE(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BDMPG,!
+5 WRITE !,$$CTR("IHS DIABETES CARE AND OUTCOMES AUDIT REPORT - RPMS AUDIT",80),!
+6 NEW BDMDHDR
+7 SET BDMDHDR="SDPI Required Key Measures Report [2015 Version] ("_$$DATE^BDMS9B1(BDMBDAT)_" to "_$$DATE^BDMS9B1(BDMADAT)_")"
+8 WRITE $$CTR(BDMDHDR,80),!
+9 ;W $$CTR("AUDIT REPORT FOR 2016 (Audit Period "_$$DATE^BDMS9B1(BDMBDAT)_" to "_$$DATE^BDMS9B1(BDMADAT)_")"),!
+10 SET X="Facility: "_$PIECE(^DIC(4,$SELECT($GET(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U)
WRITE $$CTR(X,80),!
+11 ;S X="Annual Audit/SDPI Reporting" W !,$$CTR(X,80),!
+12 SET X=$PIECE(BDMCUML(10,3),U,3)_" patients were audited*"
WRITE !,$$CTR(X),!
+13 WRITE $TRANSLATE($JUSTIFY("",80)," ","-"),!
+14 WRITE ?45,"# of ",?57,"#",?70,"Percent",!
+15 WRITE ?45,"Patients",?57,"Considered",!
+16 WRITE ?45,"(Numerator)",?57,"(Denominator)",!
+17 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 ;----------
EOP ;EP - End of page.
+1 IF $EXTRACT(IOST)'="C"
QUIT
+2 IF $DATA(ZTQUEUED)!'(IOT="TRM")!$DATA(IO("S"))
QUIT
+3 NEW DIR
+4 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
+5 SET DIR(0)="E"
DO ^DIR
+6 QUIT
+7 ;----------
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 ;----------