source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTAUIRR.m@ 1446

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1YTAUIRR ;ALB/ASF- AUI-R REPORT ;11/15/90 16:58 ; 4/6/07 4:12pm
2 ;;5.01;MENTAL HEALTH;**37,85**;Dec 30, 1994;Build 48
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 Q:YSTY["X" ;--> out ASF 09/15/04
26 S X1="",$P(X1,"# ",60)=""
27 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
28 D DTA W !!?(72-$L(X)\2),X,!!!?4,"S C A L E",?22,"RAW DECILE RANK"
29 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))
30 Q
31IR ;
32 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))
33 S K=K\10+$Y D DTA S X=$P(^YTT(601,YSTEST,"P"),U) W !!?(72-$L(X)/2),X
34 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
35R2 ;
36 D RD S A=$L(X),B=A\10 I B S K=10 F I=1:1:B D RLN Q:YSLFT
37 G:YSLFT DONE
38 S K=-10*B+A I K D RLN G DONE
39 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
40DONE ;
41 K YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,I,P,YSMX,YSTL,YSTTL Q
42RLN ;
43 W ?1 F YSKK=1:1:K W $J(YSIT,3,0)," ",$E(X,YSIT-M)," " S YSIT=YSIT+1
44 D:'P0&($Y>21) SCR:I<B W ! Q
45SCR ;
46 ; Added 5/6/94 LJA
47 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
48 N N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
49 N V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
50 ;
51 F I0=1:1:(IOSL-$Y-2) W !
52 N DTOUT,DUOUT,DIRUT
53 S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT)
54 W @IOF Q
55DTA ;
56 D KVAR^VADPT S DFN=YSDFN
57 D DEM^VADPT,PID^VADPT
58 S YSNM=VADM(1),YSSEX=$P(VADM(5),U),YSDOB=$P(VADM(3),U,2),YSAGE=VADM(4),YSSSN=VA("PID"),YSBID=VA("BID")
59 D KVAR^VADPT
60 S X0=^YTD(601.2,YSDFN,1,YSET,1,YSED,0),YSDTA=$P(X0,U,5) S:YSDTA'="" YSDTA=$$FMTE^XLFDT(YSDTA,"5ZD")
61 S YSSX=YSSEX,YSBL=" ",YSHDR=YSSSN_" "_YSNM_YSBL_YSBL_YSBL,YSHD=DT
62 S YSHDR=$E(YSHDR,1,43)_" "_YSSEX_" AGE "_$J(YSAGE,2,0)_" "_YSDT(0)_" "_$$FMTE^XLFDT(YSHD,"5ZD") W @IOF,YSHDR," ",YSDTA
63 S X=$P(^YTT(601,YSTEST,"P"),U)
64 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")
65 W ?53,"PRINTED ENTERED " W:YSDTA'="" "ADMIN" Q
66H1 ;
67 W !,"PRIMARY SCALES",!?2,"Benefits" Q
68H5 ;
69 W !!?2,"Styles" Q
70H8 ;
71 W !!?2,"Consequences" Q
72H13 ;
73 W !!?2,"Concerns and Acknowledgements" Q
74H18 ;
75 W !!,"SECOND ORDER FACTOR SCALES" Q
76H24 ;
77 W !!,"GENERAL ALCOHOL INVOLVEMENT SCALE" Q
Note: See TracBrowser for help on using the repository browser.