YTSDERS ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR DERS
;;5.01;MENTAL HEALTH;**139,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,NONACPT,GOALS,IMPLUSE,STRATEGY,AWARNESS,CLARITY
N YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCR,I,YSARRAY
;
; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
I YSTRNG=1 D SCORESV Q
I YSTRNG=2 Q ;D
;
Q
;
STRING ;
Q
;
DATA1 ;
;
;"Scale1=932^232^1^Non-acceptance of emotional responses^Accp"
;"Scale2=933^232^2^Difficulties engaging in goal-directed behavior^Goals"
;"Scale3=934^232^3^Impulse control difficulties^Impul"
;"Scale4=935^232^4^Limited access to emotion regulation strategies^Strat"
;"Scale5=936^232^5^Lack of emotional awareness^Aware"
;"Scale6=937^232^6^Lack of emotional clarity^Clar"
;"Scale7=1320^232^7^TOTAL" ;
N I
F I=3:1:38 S YSARRAY(1320)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(1320))
F I=13,14,23,25,27,31 S YSARRAY(932)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(932))
F I=15,20,22,28,35 S YSARRAY(933)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(933))
F I=5,16,21,26,29,34 S YSARRAY(934)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(934))
F I=17,18,24,30,32,33,37,38 S YSARRAY(935)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(935))
F I=4,8,10,12,19,36 S YSARRAY(936)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(936))
F I=3,6,7,9,11 S YSARRAY(937)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")+$G(YSARRAY(937))
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"
;S YSSCNAM=$P($G(^TMP($J,"YSG",3)),U,4) ; Scale Name
;
K ^TMP($J,"YSCOR")
;
S ^TMP($J,"YSCOR",1)="[DATA]"
S I=""
F I=3:1:9 D
.S YSSCALIEN=$P($P(^TMP($J,"YSG",I),"^",1),"=",2)
.S ^TMP($J,"YSCOR",I)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_+$FN(YSARRAY(YSSCALIEN),"",2)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSDERS 2333 printed Dec 13, 2024@02:19:43 Page 2
YTSDERS ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR DERS
+1 ;;5.01;MENTAL HEALTH;**139,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,NONACPT,GOALS,IMPLUSE,STRATEGY,AWARNESS,CLARITY
+4 NEW YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCR,I,YSARRAY
+5 ;
+6 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
+7 IF YSTRNG=1
DO SCORESV
QUIT
+8 ;D
IF YSTRNG=2
QUIT
+9 ;
+10 QUIT
+11 ;
STRING ;
+1 QUIT
+2 ;
DATA1 ;
+1 ;
+2 ;"Scale1=932^232^1^Non-acceptance of emotional responses^Accp"
+3 ;"Scale2=933^232^2^Difficulties engaging in goal-directed behavior^Goals"
+4 ;"Scale3=934^232^3^Impulse control difficulties^Impul"
+5 ;"Scale4=935^232^4^Limited access to emotion regulation strategies^Strat"
+6 ;"Scale5=936^232^5^Lack of emotional awareness^Aware"
+7 ;"Scale6=937^232^6^Lack of emotional clarity^Clar"
+8 ;"Scale7=1320^232^7^TOTAL" ;
+9 NEW I
+10 FOR I=3:1:38
SET YSARRAY(1320)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(1320))
+11 FOR I=13,14,23,25,27,31
SET YSARRAY(932)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(932))
+12 FOR I=15,20,22,28,35
SET YSARRAY(933)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(933))
+13 FOR I=5,16,21,26,29,34
SET YSARRAY(934)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(934))
+14 FOR I=17,18,24,30,32,33,37,38
SET YSARRAY(935)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(935))
+15 FOR I=4,8,10,12,19,36
SET YSARRAY(936)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(936))
+16 FOR I=3,6,7,9,11
SET YSARRAY(937)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")+$GET(YSARRAY(937))
+17 QUIT
+18 ;
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 ;S YSSCNAM=$P($G(^TMP($J,"YSG",3)),U,4) ; Scale Name
+8 ;
+9 KILL ^TMP($JOB,"YSCOR")
+10 ;
+11 SET ^TMP($JOB,"YSCOR",1)="[DATA]"
+12 SET I=""
+13 FOR I=3:1:9
Begin DoDot:1
+14 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",I),"^",1),"=",2)
+15 SET ^TMP($JOB,"YSCOR",I)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_+$FNUMBER(YSARRAY(YSSCALIEN),"",2)
End DoDot:1
+16 QUIT
+17 ;