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

YTSSWEM.m

Go to the documentation of this file.
YTSSWEM ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR SWEMWBS
 ;;5.01;MENTAL HEALTH;**150,172**;DEC 30,1994;Build 10
 ;
 ;Public, Supported ICRs
 ; #2056 - Fileman API - $$GET1^DIQ
 ;
 Q
 ;
DLLSTR(YSDATA,YS,YSTRNG) ;
 ;  YSTRNG = 1 Score Instrument
 ;  YSTRNG = 2 get Report Answers and Text
 N DATA,DES,LEG,NODE,YSQN,YSSCALIEN,TOTSCORE,QUES,BASIS,TOTSCR
 N YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCORE,METARRAY
 ;
 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
 I YSTRNG=1 D METRIC(.METARRAY),SCORESV Q
 I YSTRNG=2 Q  ;D
 ;
 Q
 ;
STRING ;
 Q
 ;
DATA1 ;
 ;
 N I,II
 S TOTSCORE=0,II=1
 F I=3:1:9 S TOTSCORE(II)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I"),II=II+1
 F I=1:1 S TOTSCORE=$G(TOTSCORE)+$G(TOTSCORE(I)) Q:'$D(TOTSCORE(I))
 Q
 ;
SCORESV ;
 N YSSCGROUP,II,J
 D DATA1
 I $D(^TMP($J,"YSG",1)),^TMP($J,"YSG",1)="[ERROR]" D  Q  ;-->out
 .K ^TMP($J,"YSCOR")
 .S ^TMP($J,"YSCOR",1)="[ERROR]"
 .S ^TMP($J,"YSCOR",2)=$G(YSINSNAM)_" Scale not found"
 ;
 K ^TMP($J,"YSCOR")
 ;
 S ^TMP($J,"YSCOR",1)="[DATA]"
 S II=1,J=1
 F I=3:1:9 D
 .S YSSCALIEN=$P($P(^TMP($J,"YSG",I),"^",1),"=",2)
 .S J=J+1,^TMP($J,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FN(TOTSCORE(II),"",2),II=II+1
 S YSSCALIEN=$P($P(^TMP($J,"YSG",10),"^",1),"=",2)
 S J=J+1,^TMP($J,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FN(METARRAY(TOTSCORE),"",2)
 Q
 ;
METRIC(METARRAY) ;
 ;
 S METARRAY(7)="7.00"
 S METARRAY(8)=9.51
 S METARRAY(9)=11.25
 S METARRAY(10)=12.40
 S METARRAY(11)=13.33
 S METARRAY(12)=14.08
 S METARRAY(13)=14.75
 S METARRAY(14)=15.32
 S METARRAY(15)=15.84
 S METARRAY(16)=16.36
 S METARRAY(17)=16.88
 S METARRAY(18)=17.43
 S METARRAY(19)=17.98
 S METARRAY(20)=18.59
 S METARRAY(21)=19.25
 S METARRAY(22)=19.98
 S METARRAY(23)=20.73
 S METARRAY(24)=21.54
 S METARRAY(25)=22.35
 S METARRAY(26)=23.21
 S METARRAY(27)=24.11
 S METARRAY(28)=25.03
 S METARRAY(29)=26.02
 S METARRAY(30)=27.03
 S METARRAY(31)=28.13
 S METARRAY(32)=29.31
 S METARRAY(33)=30.70
 S METARRAY(34)=32.55
 S METARRAY(35)="35.00"
 Q
 ;