YTBECK ;SLC/DKG-TEST PKG: BECK DEPRESSION SCALE ; 10/19/88 17:17 ;
;;5.01;MENTAL HEALTH;;Dec 30, 1994
;
S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,1),R=0 F I=1:1:21 S R=$S($E(X,I)'="X":R+$E(X,I)-1,1:R)
D DTA^YTREPT W !!?21,$P(^YTT(601,YSTEST,"P"),U),!!,^YTT(601,YSTEST,"G",1,1,1,0),R,"."
I R<11 W ! F I=2,3 W !,^YTT(601,YSTEST,"G",I,1,1,0)
I R<11 G NX
I R<15 W ! F I=4,5 W !,^YTT(601,YSTEST,"G",I,1,1,0)
I R<15 G NX
W !!,"THIS SCORE IS CONSISTENT WITH A "
W $S(R<20:"MILD",R<23:"MILD TO MODERATE",R<26:"MODERATE",R<31:"MODERATE TO SEVERE",1:"SEVERE")," LEVEL OF DEPRESSION."
NX ;
S H=6 F L=4:-1:2 S YSLFT=0 D SY Q:YSLFT
W ! K H,I,L,R,X,Y Q
SY ;
I X'[L G S1
S Y=^YTT(601,YSTEST,"G",H,1,1,0) D:IOST?1"C-".E WAIT Q:YSLFT W !!?(72-$L(Y)\2),Y,!
F I=1:1:21 I $E(X,I)=L D:IOST?1"C-".E WAIT:$Y>(IOSL-4) Q:YSLFT W !,^YTT(601,YSTEST,"G",I+H,1,1,0)
S1 ;
S H=H+22 Q
WAIT ;
; Added 5/6/94 LJA
N A,B,B1,C,D,E,E1,F,F1,G,G1,H,I,J,J1,J2,J3,J4,K,L,L1,L2,M,N
N N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
N V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
;
F I0=1:1:(IOSL-$Y-2) W !
N DTOUT,DUOUT,DIRUT
S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT)
W @IOF Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTBECK 1237 printed Dec 13, 2024@02:17:02 Page 2
YTBECK ;SLC/DKG-TEST PKG: BECK DEPRESSION SCALE ; 10/19/88 17:17 ;
+1 ;;5.01;MENTAL HEALTH;;Dec 30, 1994
+2 ;
+3 SET X=^YTD(601.2,YSDFN,1,YSET,1,YSED,1)
SET R=0
FOR I=1:1:21
SET R=$SELECT($EXTRACT(X,I)'="X":R+$EXTRACT(X,I)-1,1:R)
+4 DO DTA^YTREPT
WRITE !!?21,$PIECE(^YTT(601,YSTEST,"P"),U),!!,^YTT(601,YSTEST,"G",1,1,1,0),R,"."
+5 IF R<11
WRITE !
FOR I=2,3
WRITE !,^YTT(601,YSTEST,"G",I,1,1,0)
+6 IF R<11
GOTO NX
+7 IF R<15
WRITE !
FOR I=4,5
WRITE !,^YTT(601,YSTEST,"G",I,1,1,0)
+8 IF R<15
GOTO NX
+9 WRITE !!,"THIS SCORE IS CONSISTENT WITH A "
+10 WRITE $SELECT(R<20:"MILD",R<23:"MILD TO MODERATE",R<26:"MODERATE",R<31:"MODERATE TO SEVERE",1:"SEVERE")," LEVEL OF DEPRESSION."
NX ;
+1 SET H=6
FOR L=4:-1:2
SET YSLFT=0
DO SY
if YSLFT
QUIT
+2 WRITE !
KILL H,I,L,R,X,Y
QUIT
SY ;
+1 IF X'[L
GOTO S1
+2 SET Y=^YTT(601,YSTEST,"G",H,1,1,0)
if IOST?1"C-".E
DO WAIT
if YSLFT
QUIT
WRITE !!?(72-$LENGTH(Y)\2),Y,!
+3 FOR I=1:1:21
IF $EXTRACT(X,I)=L
if IOST?1"C-".E
if $Y>(IOSL-4)
DO WAIT
if YSLFT
QUIT
WRITE !,^YTT(601,YSTEST,"G",I+H,1,1,0)
S1 ;
+1 SET H=H+22
QUIT
WAIT ;
+1 ; Added 5/6/94 LJA
+2 NEW A,B,B1,C,D,E,E1,F,F1,G,G1,H,I,J,J1,J2,J3,J4,K,L,L1,L2,M,N
+3 NEW N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
+4 NEW V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
+5 ;
+6 FOR I0=1:1:(IOSL-$Y-2)
WRITE !
+7 NEW DTOUT,DUOUT,DIRUT
+8 SET DIR(0)="E"
DO ^DIR
KILL DIR
SET YSTOUT=$DATA(DTOUT)
SET YSUOUT=$DATA(DUOUT)
SET YSLFT=$DATA(DIRUT)
+9 WRITE @IOF
QUIT