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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSEAT26 2251 printed Nov 22, 2024@17:29:45 Page 2
YTSEAT26 ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR EAT-26
+1 ;;5.01;MENTAL HEALTH;**150,234**;DEC 30,1994;Build 38
+2 ;
+3 ;Public, Supported ICRs
+4 ; #2056 - Fileman API - $$GET1^DIQ
+5 ;
+6 QUIT
+7 ;
DLLSTR(YSDATA,YS,YSTRNG) ;
+1 ; YSTRNG = 1 Score Instrument
+2 ; YSTRNG = 2 get Report Answers and Text
+3 NEW DATA,DES,LEG,NODE,YSQN,YSSCALIEN,TOTSCORE,QUES,BASIS,TOTSCR
+4 NEW YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCORE,STRING,STRING2
+5 ;
+6 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
+7 NEW QSTN
+8 DO BLDQSTN(.QSTN)
+9 IF YSTRNG=1
DO SCORESV
QUIT
+10 IF YSTRNG=2
Begin DoDot:1
+11 DO STRING
+12 ; get last node
NEW N
SET N=$ORDER(YSDATA(""),-1)
+13 SET YSDATA(N+1)="7772^9999;1^"_STRING
+14 SET YSDATA(N+2)="7773^9999;1^"_STRING2
End DoDot:1
+15 ;
+16 QUIT
+17 ;
STRING ;
+1 NEW CURWT,HT,BMI,YSALERT
+2 SET CURWT=$GET(QSTN(8454))
+3 SET HT=($GET(QSTN(8453))*12)+$GET(QSTN(8459))
+4 SET BMI=((CURWT*703)/HT)/HT
+5 SET STRING=$FNUMBER(BMI,"",2)
+6 ;
+7 SET STRING2="NO"
+8 DO YSALERT(.YSALERT)
+9 IF 2345[YSALERT("A")
SET STRING2="YES"
QUIT
+10 IF 12345[YSALERT("B")
SET STRING2="YES"
QUIT
+11 IF 12345[YSALERT("C")
SET STRING2="YES"
QUIT
+12 IF YSALERT("D")=5
SET STRING2="YES"
QUIT
+13 IF YSALERT("E")=1
SET STRING2="YES"
QUIT
+14 ;
+15 QUIT
BLDQSTN(QSTN) ; build list of questions and response values in .QSTN
+1 ; expects YSDATA from DLLSTR
+2 NEW I
+3 SET I=2
FOR
SET I=$ORDER(YSDATA(I))
if 'I
QUIT
SET QSTN($PIECE(YSDATA(I),U))=$PIECE(YSDATA(I),U,3)
+4 QUIT
+5 ;
DATA1 ;
+1 ;
+2 NEW I,II
+3 SET TOTSCORE=0
+4 FOR I=8420:1:8445
SET TOTSCORE=TOTSCORE+$$GET1^DIQ(601.75,$GET(QSTN(I))_",",4,"I")
+5 QUIT
+6 ;
SCORESV ;
+1 NEW YSSCGROUP,I
+2 DO DATA1
+3 ;-->out
IF $DATA(^TMP($JOB,"YSG",1))
IF ^TMP($JOB,"YSG",1)="[ERROR]"
Begin DoDot:1
+4 KILL ^TMP($JOB,"YSCOR")
+5 SET ^TMP($JOB,"YSCOR",1)="[ERROR]"
+6 SET ^TMP($JOB,"YSCOR",2)=$GET(YSINSNAM)_" Scale not found"
End DoDot:1
QUIT
+7 ;
+8 KILL ^TMP($JOB,"YSCOR")
+9 ;
+10 SET ^TMP($JOB,"YSCOR",1)="[DATA]"
+11 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",3),"^",1),"=",2)
+12 SET ^TMP($JOB,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_TOTSCORE
+13 QUIT
+14 ;
YSALERT(YSALERT) ;ARRAY FOR BEHAVIORAL ALERTS
+1 ;
+2 SET YSALERT("A")=$$GET1^DIQ(601.75,+$GET(QSTN(8446))_",",4,"I")
+3 SET YSALERT("B")=$$GET1^DIQ(601.75,+$GET(QSTN(8447))_",",4,"I")
+4 SET YSALERT("C")=$$GET1^DIQ(601.75,+$GET(QSTN(8448))_",",4,"I")
+5 SET YSALERT("D")=$$GET1^DIQ(601.75,+$GET(QSTN(8449))_",",4,"I")
+6 SET YSALERT("E")=$$GET1^DIQ(601.75,+$GET(QSTN(8450))_",",4,"I")
+7 ;
+8 QUIT