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

YSMTI5.m

Go to the documentation of this file.
YSMTI5 ;ALBANY/ASF PSYCH TEST DOWNLOAD SF36 ;7/16/99  10:09
 ;;5.01;MENTAL HEALTH;**53**;Dec 30, 1994
 N YSX
SCOR ;GET RESPONSES
 S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,1)
 ;ARRAY SET
 F I=1:1:36 S YSX(I)=$E(X,I)
RV ;REVERSE SCORE 10 ITEMS
 F I=21,22,1,34,36,23,27,20,26,30 I YSX(I)'="X" S YSMX=$P(^YTT(601,YSTEST,"Q",I,0),U,2),YSMX=$E(YSMX,$L(YSMX)-1)+1,YSX(I)=YSMX-YSX(I)
 ;RECODE 3 ITEMS 
  S YSX(1)=YSX(1)+$S($E(X,1)=2:.4,$E(X,1)=3:.4,1:0)
  S:YSX(21)'="X" YSX(21)=YSX(21)+$S($E(X,21)=2:.4,$E(X,21)=3:.2,$E(X,21)=4:.1,$E(X,21)=5:.2,1:0)
 I ($E(X,22)=1)&($E(X,21)=1) S YSX(22)=6
 I $E(X,21)="X"&(YSX(22)'="X") S YSX(22)=YSX(22)+$S($E(X,22)=1:1,$E(X,22)=2:.75,$E(X,22)=3:.5,$E(X,22)=4:.25,1:0)
RAWER ;RAW CALCULATIONS
 K S S R="" F J=1:1:9 S YSN=0,YSXN=0 D RAW1 D:YSXN>0 MISS
 G STND Q
RAW1 S YSKK=^YTT(601,YSTEST,"S",J,"K",1,0)
 F I=1:2 S A=$P(YSKK,U,I) Q:A=""  D RAW2
 Q
RAW2 S $P(R,U,J)=$P(R,U,J)+YSX(A)
 I YSX(A)="X" S YSXN=YSXN+1
 S YSN=YSN+1
 Q
MISS ;MISSING ITEM RECODE BY MEANS
 S B=$P("10^4^2^5^4^2^3^5^1",U,J)
 I YSXN/B>.5 S $P(R,U,J)="*" Q
 S Y=$P(R,U,J)/(YSN-YS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