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

YTSEAT26.m

Go to the documentation of this file.
YTSEAT26 ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR EAT-26
 ;;5.01;MENTAL HEALTH;**150,234**;DEC 30,1994;Build 38
 ;
 ;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,STRING,STRING2
 ;
 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
 N QSTN
 D BLDQSTN(.QSTN)
 I YSTRNG=1 D SCORESV Q
 I YSTRNG=2 D
 .D STRING
 .N N S N=$O(YSDATA(""),-1) ; get last node
 .S YSDATA(N+1)="7772^9999;1^"_STRING
 .S YSDATA(N+2)="7773^9999;1^"_STRING2
 ;
 Q
 ;
STRING ;
 N CURWT,HT,BMI,YSALERT
 S CURWT=$G(QSTN(8454))
 S HT=($G(QSTN(8453))*12)+$G(QSTN(8459))
 S BMI=((CURWT*703)/HT)/HT
 S STRING=$FN(BMI,"",2)
 ;
 S STRING2="NO"
 D YSALERT(.YSALERT)
 I 2345[YSALERT("A") S STRING2="YES" Q
 I 12345[YSALERT("B") S STRING2="YES" Q
 I 12345[YSALERT("C") S STRING2="YES" Q
 I YSALERT("D")=5 S STRING2="YES" Q
 I YSALERT("E")=1 S STRING2="YES" Q
 ;
 Q
BLDQSTN(QSTN) ; build list of questions and response values in .QSTN
 ; expects YSDATA from DLLSTR
 N I
 S I=2 F  S I=$O(YSDATA(I)) Q:'I  S QSTN($P(YSDATA(I),U))=$P(YSDATA(I),U,3)
 Q
 ;
DATA1 ;
 ;
 N I,II
 S TOTSCORE=0
 F I=8420:1:8445 S TOTSCORE=TOTSCORE+$$GET1^DIQ(601.75,$G(QSTN(I))_",",4,"I")
 Q
 ;
SCORESV ;
 N YSSCGROUP,I
 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 YSSCALIEN=$P($P(^TMP($J,"YSG",3),"^",1),"=",2)
 S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_TOTSCORE
 Q
 ;
YSALERT(YSALERT) ;ARRAY FOR BEHAVIORAL ALERTS
 ;
 S YSALERT("A")=$$GET1^DIQ(601.75,+$G(QSTN(8446))_",",4,"I")
 S YSALERT("B")=$$GET1^DIQ(601.75,+$G(QSTN(8447))_",",4,"I")
 S YSALERT("C")=$$GET1^DIQ(601.75,+$G(QSTN(8448))_",",4,"I")
 S YSALERT("D")=$$GET1^DIQ(601.75,+$G(QSTN(8449))_",",4,"I")
 S YSALERT("E")=$$GET1^DIQ(601.75,+$G(QSTN(8450))_",",4,"I")
 ;
 Q