source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTMBMD.m@ 862

Last change on this file since 862 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.0 KB
RevLine 
[613]1YTMBMD ;ALB/ASF-MBMD ; 2/6/04 9:09am
2 ;;5.01;MENTAL HEALTH;**76,83**;Dec 30, 1994
3MAIN ;
4 N A,B,G,I,L1,L2,N,X,YSANS,YSDAS,YSDAS1,YSIN,YSSID,YSTOUT,YSUOUT,YSVFLAG
5 D PTVAR^YSLRP
6 D RD
7 D VALIDITY ;Q:YSVFLAG
8 D RAW
9 D PS1
10 D RPA
11 D HPA
12 D HPA1
13 D:YSTY["*" REPT
14 Q
15RD S X=^YTD(601.2,YSDFN,1,YSTEST,1,YSED,1)
16 Q
17VALIDITY ;check if ok to score
18 S YSVFLAG=0
19 I $L(X,"X")>11 S YSVFLAG=1 Q
20 I ($E(X,106)="T")&($E(X,124)="T") S YSVFLAG=1 Q
21 I (YSAGE<18)!(YSAGE>85) S YSVFLAG=1 Q
22 Q
23RAW ; raw scores
24 S R="0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0"
25 S N=0 F S N=$O(^YTT(601,YSTEST,"S",N)) Q:N'>0 D
26 . S G=^YTT(601,YSTEST,"S",N,"K",1,0),I=1
27 . F S YSIN=$P(G,U,I),YSANS=$E($P(G,U,I+1),1),YSWT=$P($P(G,U,I+1),";",2),I=I+2 Q:YSIN="" S:$E(X,YSIN)=YSANS $P(R,U,N)=$P(R,U,N)+YSWT
28 Q
29PS1 ; untransformed prevelence scores
30 S S="0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0"
31 F I=11:1:39 S $P(S,U,I)=$P(^YTT(601,YSTEST,"S",I,YSSEX),U,$P(R,U,I)+1)
32 S X=$P(R,U,2) S $P(S,U,2)=$S(X<9:"L",X=9:"M",X=10:"H",1:0) ;scale X ASF 1/30/04
33 S X=$P(R,U,3) S $P(S,U,3)=$S(X<10:"L",X<13:"M",X>12:"H",1:0) ;scale Y ASF 1/30/04
34 S X=$P(R,U,4) S $P(S,U,4)=$S(X<5:"L",X=5:"M",X>5:"H",1:0) ;scale Z ASF 1/30/04
35 F I=5:1:10 S X=$P(R,U,I) S $P(S,U,I)=$S(X=0:"L",X=1:"M",X>1:"H",1:0) ;indicators ASF 1/30/04
36 Q
37RPA ;Response Pattern Adjustment
38 S YSDAS=0
39 I ($P(S,U,2)="H")&($P(S,U,3)="H")&($P(S,U,4)'="H") S YSDAS=10
40 I ($P(S,U,2)'="H")&($P(S,U,3)="H")&($P(S,U,4)'="H") S YSDAS=10
41 I ($P(S,U,2)="H")&($P(S,U,3)'="H")&($P(S,U,4)'="H") S YSDAS=-5
42 I ($P(S,U,2)="H")&($P(S,U,3)'="H")&($P(S,U,4)="H") S YSDAS=-10
43 I ($P(S,U,2)'="H")&($P(S,U,3)'="H")&($P(S,U,4)="H") S YSDAS=-10
44 F I=11,12,13,14,15,27,28,29,30,31,32,33,34,35,36,37,38,39 S $P(S,U,I)=$P(S,U,I)+YSDAS
45 Q
46HPA ;High Point Adjustment COPING
47 S N=0 F I=16:1:26 S:$P(S,U,I)>59 N=N+1
48 S YSDAS=$S(N>9:-10,N>7:-5,N>4:0,N>2:5,N>0:10,1:15)
49 F I=16:1:26 S $P(S,U,I)=$P(S,U,I)+YSDAS
50 Q
51HPA1 ;high point AA-EE, a-m
52 S N=0
53 F I=11,12,13,14,15,27,28,29,30,31,32,33,34,35,36,37,38,39 S:$P(S,U,I)>59 N=N+1
54 S YSDAS=$S(N>16:-15,N>14:-10,N>12:-5,N>7:0,N>5:5,N>2:10,1:15)
55 S YSDAS1=$S(N>12:0,N>7:5,N>5:10,N>2:15,1:20)
56 F I=11,12,13,14,15,27,28,29,30,31,32,33,34,35,36,37 S $P(S,U,I)=$P(S,U,I)+YSDAS
57 F I=38,39 S $P(S,U,I)=$P(S,U,I)+YSDAS1
58 Q
59REPT ;reports
60 S (YSTOUT,YSUOUT)=""
61 S X=$P(^YTT(601,YSTEST,"P"),U),A=$P(^("P"),U,2),B=$P(^("P"),U,3),L1=58-A\2,L2=L1+A+4 S:A<9 A=9
62 D DTA^YTREPT
63 W !,?(72-$L(X)\2),X,!
64 W !?50,$S(YSVFLAG:"*** Invalid Profile ***",1:"Valid Profile")
65 F I=2:1:10 D D:IOST?1"C-".E&($Y>21) SCR^YTREPT Q:YSTOUT!YSUOUT
66 . W:I=2 !,"Response Patterns" ;ASF 1/30/04 ABOVE LINE ALSO
67 . W:I=5 !,"Negative Health Habits"
68 . W !,?4,$P(^YTT(601,YSTEST,"S",I,0),U,2),?25 D LIKELY
69 D:IOST?1"C-".E&($Y>21) SCR^YTREPT Q:YSTOUT!YSUOUT
70 F I=11:1:39 D D:IOST?1"C-".E&($Y>21) SCR^YTREPT Q:YSTOUT!YSUOUT
71 . W:I=11 !,"Psychiatric Indications"
72 . W:I=16 !,"Coping Styles"
73 . W:I=27 !,"Stress Moderators"
74 . W:I=33 !,"Treatment Prognostics"
75 . W:I=38 !,"Management Guides"
76 . S YSSID=$P(^YTT(601,YSTEST,"S",I,0),U,2)
77 . W !,$P(YSSID," ")
78 . W ?5,$J($P(R,U,I),2)," ",$S($P(S,U,I)'<0:$J($P(S,U,I),3),1:" 0")," "
79 . D CHART
80 . W ?52,$P(YSSID," ",2,99)
81 D NOTEWOR
82 Q
83LIKELY ;
84 N X
85 S X=$P(S,U,I)
86 W $S(X="L":"unlikely problem",X="M":"possible problem",X="H":"likely problem",1:"????")
87 Q
88CHART ;
89 N X
90 S X=$P(S,U,I)
91 W $E("***************************************************************",1,$J(X/3,0,0))
92 Q
93NOTEWOR ;note worthy responses
94 D RD
95 W !!?10,"*** Noteworthy Responses ***"
96 F I=1,14,28,66,6,117,131,157,3,20,41,62,5,10,103,116,143,49 D D:IOST?1"C-".E&($Y>21) SCR^YTREPT Q:YSTOUT!YSUOUT
97 .W:I=1 !!?4,"Panic Susceptibility"
98 .W:I=6 !!?4,"Disorientation"
99 .W:I=3 !!?4,"Medical Anxiety"
100 .W:I=5 !!?4,"Adherence Problems"
101 .W:I=49 !!?4,"Suicidal Tendencies"
102 . W:$E(X,I)="T" !,$J(I,3,0),". ",^YTT(601,YSTEST,"Q",I,"T",1,0)
103 I (($E(X,49)="T")&($E(X,58)="T"))!(($E(X,161)="T")&($E(X,58)="T")) W !," 58. ",^YTT(601,YSTEST,"Q",58,"T",1,0)
104 I (($E(X,49)="T")&($E(X,161)="T"))!(($E(X,161)="T")&($E(X,58)="T")) W !,"161. ",^YTT(601,YSTEST,"Q",161,"T",1,0)
Note: See TracBrowser for help on using the repository browser.