YTPHQ9 ;ALB/ASF- TEST PRIME MD PHQ9 ;7/2/03 14:23
;;5.01;MENTAL HEALTH;**70**;Dec 30, 1994
;
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,R1,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
S YSNOITEM="DONE^YTPHQ9"
S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,1)
S R=0
F I=1:1:9 S R=$S($E(X,I)'="X":R+$E(X,I)-1,1:R)
S YSNX=$L(X,"X")-1
S YSN3=$L(X,3)-1,YSN4=$L(X,4)-1
S S=""
I (($E(X,1)>2)!($E(X,2)>2))&(($E(X,2)>2)) S S="Other Depressive Syndrome"
I (($E(X,1)>2)!($E(X,2)>2))&(($E(X,3)>2)) S S="Other Depressive Syndrome"
I (($E(X,1)>2)!($E(X,2)>2))&(($E(X,4)>2)) S S="Other Depressive Syndrome"
I (($E(X,1)>2)!($E(X,2)>2))&((YSN3+YSN4)>4) S S="Major Depressive Syndrome"
Q:YSTY'["*"
D DTA^YTREPT
W !?21,$P(^YTT(601,YSTEST,"P"),U)
W !,$S(S'="":"**** "_S_" suggested ****",1:"No depressive syndrome suggested")
W !,"PHQ9 score= ",R
S N=0 F S N=$O(^YTT(601,YSET,"G",1,1,N)) Q:N'>0 W !,^YTT(601,YSET,"G",1,1,N,0)
;W:(R>14) !,"This score warrants treatment for depression using antidepressant, psychotherapy and/or a combination of treatment."
;W:((R>4)&(R<15)) !,"This score suggests Physician uses clinical judgement about treatment based on patient's duration of symptoms and functional impairment."
;W:(R<5) !,"This score suggests the patient may not need depression treatment"
W !
F I=1:1:9 W !,$S($E(X,I)="X":"X",1:$E(X,I)-1)_" "_$C(96+I)_"."_$E(^YTT(601,YSET,"Q",I,"T",1,0),1,60) W:$D(^YTT(601,YSET,"Q",I,"T",2,0)) " ..."
W !!,"0= Not at all 1= Several days 2= More than half the days 3= Nearly every day"
D:$Y+4>IOSL WAIT
DONE Q
WAIT ;
; Added 5/6/94 LJA
;
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[HYTPHQ9 1835 printed Oct 16, 2024@18:18:43 Page 2
YTPHQ9 ;ALB/ASF- TEST PRIME MD PHQ9 ;7/2/03 14:23
+1 ;;5.01;MENTAL HEALTH;**70**;Dec 30, 1994
+2 ;
+3 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
+4 NEW N1,N2,N3,N4,P,P0,P1,P3,R1,S1,T,T1,T2,TT,V,V1,V2,V3
+5 NEW V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
+6 SET YSNOITEM="DONE^YTPHQ9"
+7 SET X=^YTD(601.2,YSDFN,1,YSET,1,YSED,1)
+8 SET R=0
+9 FOR I=1:1:9
SET R=$SELECT($EXTRACT(X,I)'="X":R+$EXTRACT(X,I)-1,1:R)
+10 SET YSNX=$LENGTH(X,"X")-1
+11 SET YSN3=$LENGTH(X,3)-1
SET YSN4=$LENGTH(X,4)-1
+12 SET S=""
+13 IF (($EXTRACT(X,1)>2)!($EXTRACT(X,2)>2))&(($EXTRACT(X,2)>2))
SET S="Other Depressive Syndrome"
+14 IF (($EXTRACT(X,1)>2)!($EXTRACT(X,2)>2))&(($EXTRACT(X,3)>2))
SET S="Other Depressive Syndrome"
+15 IF (($EXTRACT(X,1)>2)!($EXTRACT(X,2)>2))&(($EXTRACT(X,4)>2))
SET S="Other Depressive Syndrome"
+16 IF (($EXTRACT(X,1)>2)!($EXTRACT(X,2)>2))&((YSN3+YSN4)>4)
SET S="Major Depressive Syndrome"
+17 if YSTY'["*"
QUIT
+18 DO DTA^YTREPT
+19 WRITE !?21,$PIECE(^YTT(601,YSTEST,"P"),U)
+20 WRITE !,$SELECT(S'="":"**** "_S_" suggested ****",1:"No depressive syndrome suggested")
+21 WRITE !,"PHQ9 score= ",R
+22 SET N=0
FOR
SET N=$ORDER(^YTT(601,YSET,"G",1,1,N))
if N'>0
QUIT
WRITE !,^YTT(601,YSET,"G",1,1,N,0)
+23 ;W:(R>14) !,"This score warrants treatment for depression using antidepressant, psychotherapy and/or a combination of treatment."
+24 ;W:((R>4)&(R<15)) !,"This score suggests Physician uses clinical judgement about treatment based on patient's duration of symptoms and functional impairment."
+25 ;W:(R<5) !,"This score suggests the patient may not need depression treatment"
+26 WRITE !
+27 FOR I=1:1:9
WRITE !,$SELECT($EXTRACT(X,I)="X":"X",1:$EXTRACT(X,I)-1)_" "_$CHAR(96+I)_"."_$EXTRACT(^YTT(601,YSET,"Q",I,"T",1,0),1,60)
if $DATA(^YTT(601,YSET,"Q",I,"T",2,0))
WRITE " ..."
+28 WRITE !!,"0= Not at all 1= Several days 2= More than half the days 3= Nearly every day"
+29 if $Y+4>IOSL
DO WAIT
DONE QUIT
WAIT ;
+1 ; Added 5/6/94 LJA
+2 ;
+3 FOR I0=1:1:(IOSL-$Y-2)
WRITE !
+4 NEW DTOUT,DUOUT,DIRUT
+5 SET DIR(0)="E"
DO ^DIR
KILL DIR
SET YSTOUT=$DATA(DTOUT)
SET YSUOUT=$DATA(DUOUT)
SET YSLFT=$DATA(DIRUT)
+6 WRITE @IOF
QUIT