source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTAUIRR.m@ 1154

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

revised back to 6/30/08 version

File size: 2.8 KB
RevLine 
[623]1YTAUIRR ;ALB/ASF- AUI-R REPORT ;11/15/90 16:58 ;
2 ;;5.01;MENTAL HEALTH;**37**;Dec 30, 1994
3F0 ;
4 S R="",J=1
5T0 ;
6 S L=200,M=0,YSKK=1,YSTL=0 G:'$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) STND D RD
7T1 ;
8 I '$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) S R=R_YSTL_"^",J=J+1 G T0
9 S Y=^YTT(601,YSTEST,"S",J,"K",YSKK,0),P=1
10T2 ;
11 S YSIT=$P(Y,U,P) I YSIT="" S YSKK=YSKK+1 G T1
12 S A=$P(Y,U,P+1),A=$A(A)-64,P=P+2
13T3 ;
14 I +YSIT>L S L=L+200,M=M+200 D RD G T3
15 S:$E(X,+YSIT-M)=A YSTL=YSTL+$P(YSIT,"(",2) G T2
16RD ;
17 S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200) Q
18STND ;
19 S J=1,S=""
20LK ;
21 S A=$P(R,U,J) G:A="" REPT S L1=$P(^YTT(601,YSTEST,"S",J,"M"),U) I A<L1 S S=S_"0^",J=J+1 G LK
22 I $D(^YTT(601,YSTEST,"S",J,"MS")) S L2=+^YTT(601,YSTEST,"S",J,"MS") I A'<L2 S S=S_$P(^YTT(601,YSTEST,"S",J,"MS"),U,A+2-L2),J=J+1 G LK
23 S S=S_$P(^YTT(601,7,"S",J,"M"),U,A+2-L1)_"^",J=J+1 G LK
24REPT ;
25 S X1="",$P(X1,"# ",60)=""
26 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
27 D DTA W !!?(72-$L(X)\2),X,!!!?4,"S C A L E",?22,"RAW DECILE RANK"
28 F J=1:1 S YSRS=$P(R,U,J) Q:YSRS="" D:IOST?1"C-".E&($Y>21) SCR D H1:J=1,H5:J=5,H8:J=8,H13:J=13,H18:J=18,H24:J=24 W !?4,$P(^YTT(601,YSTEST,"S",J,0),U,2),?20,$J(YSRS,4,0),$J($P(S,U,J),5)," |",$E(X1,1,2*$P(S,U,J))
29 Q
30IR ;
31 S P0=$S(IOST?1"P".E:1,1:0),K=0,YSLFT=0 F I=1:1 Q:'$D(^YTD(601.2,YSDFN,1,YSET,1,YSED,I)) S K=K+$L(^(I))
32 S K=K\10+$Y D DTA S X=$P(^YTT(601,YSTEST,"P"),U) W !!?(72-$L(X)/2),X
33 W !!!?25,"--- ITEM RESPONSES ---",!! S L=200,M=0,YSIT=1 I $D(^YTD(601.2,YSDFN,1,YSTEST,1,YSHD,99)),^(99)="MMPIR" S L=800
34R2 ;
35 D RD S A=$L(X),B=A\10 I B S K=10 F I=1:1:B D RLN Q:YSLFT
36 G:YSLFT DONE
37 S K=-10*B+A I K D RLN G DONE
38 G:A<200 DONE S L=L+200,M=M+200 I $D(^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200)) G R2
39DONE ;
40 K YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,I,P,YSMX,YSTL,YSTTL Q
41RLN ;
42 W ?1 F YSKK=1:1:K W $J(YSIT,3,0)," ",$E(X,YSIT-M)," " S YSIT=YSIT+1
43 D:'P0&($Y>21) SCR:I<B W ! Q
44SCR ;
45 ; Added 5/6/94 LJA
46 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
47 N N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
48 N V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
49 ;
50 F I0=1:1:(IOSL-$Y-2) W !
51 N DTOUT,DUOUT,DIRUT
52 S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT)
53 W @IOF Q
54DTA ;
55 S X0=^YTD(601.2,YSDFN,1,YSET,1,YSED,0),YSDTA=$P(X0,U,5) S:YSDTA'="" YSDTA=$$FMTE^XLFDT(YSDTA,"5ZD")
56 S YSHDR=$E(YSHDR,1,43)_" "_YSSEX_" AGE "_$J(YSAGE,2,0)_" "_YSDT(0)_" "_$$FMTE^XLFDT(YSHD,"5ZD") W @IOF,YSHDR," ",YSDTA
57 W ! S X7=$P(X0,U),X8=$P(X0,U,8) I X8,X8<X7 W "Begun: ",$$FMTE^XLFDT(X8,"5ZD")," Finished ",$$FMTE^XLFDT(X7,"5ZD")
58 W ?53,"PRINTED ENTERED " W:YSDTA'="" "ADMIN" Q
59H1 ;
60 W !,"PRIMARY SCALES",!?2,"Benefits" Q
61H5 ;
62 W !!?2,"Styles" Q
63H8 ;
64 W !!?2,"Consequences" Q
65H13 ;
66 W !!?2,"Concerns and Acknowledgements" Q
67H18 ;
68 W !!,"SECOND ORDER FACTOR SCALES" Q
69H24 ;
70 W !!,"GENERAL ALCOHOL INVOLVEMENT SCALE" Q
Note: See TracBrowser for help on using the repository browser.