YTSSIP3B ;BAL/KTL - MHAX ANSWERS SPECIAL HANDLING FOR SHORT INVENTORY OF PROBLEMS - AD (SIP-AD-30_V2); FEB 1,2023
;;5.01;MENTAL HEALTH;**224**;DEC 30,1994;Build 17
;
; Reference to GET1^DIQ in ICR #2056
;
;
DLLSTR(YSDATA,YS,YSTRNG) ;
; YSTRNG = 1 Score Instrument
; YSTRNG = 2 get Report Answers and Text
N DATA,YSSCALIEN,TOTSCORE,YSINSNAM,STRING,TOTSCORE,PHYSICAL,INTERP,INTRAP,IMPULSE,SOCIAL
;
; CMQ 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 ;
;
N I,II
S TOTSCORE=0
F I=3:1:17 Q:'$D(YSDATA(I)) S TOTSCORE=$G(TOTSCORE)+$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")
;F I=2,7,9 S PHYSICAL=$G(PHYSICAL)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
;F I=10,11,13 S INTERP=$G(INTERP)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
;F I=1,4,12 S INTRAP=$G(INTRAP)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
;F I=5,6,15 S IMPULSE=$G(IMPULSE)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
;F I=3,8,14 S SOCIAL=$G(SOCIAL)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",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]"
;F I=3:1:8 D
;.S YSSCALIEN=$P($P(^TMP($J,"YSG",I),"^",1),"=",2)
;.S ^TMP($J,"YSCOR",I)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$S(I=3:TOTSCORE,I=4:PHYSICAL,I=5:INTERP,I=6:INTRAP,I=7:IMPULSE,1:SOCIAL)
S YSSCALIEN=$P($P(^TMP($J,"YSG",3),"^",1),"=",2)
S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_TOTSCORE
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSSIP3B 1789 printed Nov 22, 2024@17:30:51 Page 2
YTSSIP3B ;BAL/KTL - MHAX ANSWERS SPECIAL HANDLING FOR SHORT INVENTORY OF PROBLEMS - AD (SIP-AD-30_V2); FEB 1,2023
+1 ;;5.01;MENTAL HEALTH;**224**;DEC 30,1994;Build 17
+2 ;
+3 ; Reference to GET1^DIQ in ICR #2056
+4 ;
+5 ;
DLLSTR(YSDATA,YS,YSTRNG) ;
+1 ; YSTRNG = 1 Score Instrument
+2 ; YSTRNG = 2 get Report Answers and Text
+3 NEW DATA,YSSCALIEN,TOTSCORE,YSINSNAM,STRING,TOTSCORE,PHYSICAL,INTERP,INTRAP,IMPULSE,SOCIAL
+4 ;
+5 ; CMQ returns a scale score which is calculated and stored, no special text in report
+6 IF YSTRNG=1
DO SCORESV
QUIT
+7 ; D
IF YSTRNG=2
QUIT
+8 ;
+9 QUIT
+10 ;
STRING ;
+1 ;
+2 ;
+3 QUIT
+4 ;
DATA1 ;
+1 ;
+2 NEW I,II
+3 SET TOTSCORE=0
+4 FOR I=3:1:17
if '$DATA(YSDATA(I))
QUIT
SET TOTSCORE=$GET(TOTSCORE)+$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")
+5 ;F I=2,7,9 S PHYSICAL=$G(PHYSICAL)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
+6 ;F I=10,11,13 S INTERP=$G(INTERP)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
+7 ;F I=1,4,12 S INTRAP=$G(INTRAP)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
+8 ;F I=5,6,15 S IMPULSE=$G(IMPULSE)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
+9 ;F I=3,8,14 S SOCIAL=$G(SOCIAL)+$$GET1^DIQ(601.75,$P(YSDATA(I+2),"^",3)_",",4,"I")
+10 QUIT
+11 ;
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 ;F I=3:1:8 D
+12 ;.S YSSCALIEN=$P($P(^TMP($J,"YSG",I),"^",1),"=",2)
+13 ;.S ^TMP($J,"YSCOR",I)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$S(I=3:TOTSCORE,I=4:PHYSICAL,I=5:INTERP,I=6:INTRAP,I=7:IMPULSE,1:SOCIAL)
+14 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",3),"^",1),"=",2)
+15 SET ^TMP($JOB,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_TOTSCORE
+16 QUIT
+17 ;