Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: YSMTI4

YSMTI4.m

Go to the documentation of this file.
YSMTI4 ;ALB/ASF PSYCH TEST DOWNLOAD MCMI2 ;7/23/99  09:42
 ;;5.01;MENTAL HEALTH;**53**;Dec 30, 1994
 D DEM^VADPT S YSSEX=$P(VADM(5),U) K VADM
F0 S R="",J=1
T0 S L=200,M=0,YSKK=1,YSTL=0 G:J=27 STND D RD
T1 I '$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) S R=R_YSTL_"^",J=J+1 G T0
 S Y=^YTT(601,YSTEST,"S",J,"K",YSKK,0),P=1
T2 S YSIT=$P(Y,"^",P) I YSIT="" S YSKK=YSKK+1 G T1
 S A=$P(Y,"^",P+1),P=P+2
 S:$E(X,+YSIT-M)=A YSTL=YSTL+(+$P(YSIT,"(",2)) G T2
RD S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200) Q
STND S X=($P(R,U,7)*1.5)+($P(R,U,12)*1.5)+($P(R,U,4)*1.6)+($P(R,U,5)*1.6)+($P(R,U,6)*1.6)+($P(R,U,13)*1.6)+$P(R,U,8)+$P(R,U,9)+$P(R,U,10)+$P(R,U,11),X=$J(X,3,0)
 S Y=^YTT(601,201,"S",1,YSSEX) F I=1:1 I X'>(+$P(Y,U,I)) S S=$P($P(Y,U,I),",",2) Q
 S S=S_"^",$P(R,U,1)=X F J=2:1:25 S X=^YTT(601,YSTEST,"S",J,YSSX),A=$P(R,U,J),S1=$P(X,U,A+1) S:S1="" S1=$P(X,U,$L(X,U)) S S=S_S1_U
DC ;DIS C
 S X=+R I X<145!(X>590)!((X>249)&(X<401)) G HDAA
 I X>144,X<250 S YSCF=250-X\10 S:250-X/10#1 YSCF=YSCF+1 F I=4:1:25 S YSCF1=$S(I=14:.5,I=15:.5,I=16:.5,I=23:.5,I=24:.5,I=25:.5,1:1),$P(S,U,I)=$P(S,U,I)+(YS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,13,11,7,6 S:$D(YSS1(I)) YSS1=YSS1_I_U S:$D(YSS2(I)) YSS2=YSS2_I_U
 S YSS=YSS1_YSS2
 I +YSS=7!(+YSS=8)!(+YSS=11)!($P(YSS,U,2)=11) F I=14,15,16,17,20,18 S Y1=$S(I<16:4,I=16:2,I=18:13,1:15) S $P(S,U,I)=$P(S,U,I)+Y1
 I +YSS=13!(+YSS=5)!($P(YSS,U,2)=5) F I=15,16,14,17,18,20 S Y1=$S(I=14:2,I<17:6,I=17:7,1:5) S $P(S,U,I)=$P(S,U,I)-Y1
SCP ; LAST COR
 I YSIO="I",YSEP=1 F I="23,8","24,10","25,4" S $P(S,U,+I)=$P(S,U,+I)+$P(I,",",2)
 I YSIO="I",(YSEP=2!(YSEP=0)) F I="23,5","24,7","25,2" S $P(S,U,+I)=$P(S,U,+I)+$P(I,",",2)
 K Y,Y1,^TMP("YT1",$J) S S(1)=$P(S,U,1,13),S(2)=$P(S,U,14,26),R(1)=$P(R,U,1,13),R(2)=$P(R,U,14,26),(S,R)=""
 K YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,YSSS,I,P,YSMX,YSTL,YSTTL Q