YTSSIPST ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR SHORT INVENTORY OF PROBLEMS - AD (SIP-AD-START)
;;5.01;MENTAL HEALTH;**150**;DEC 30,1994;Build 210
;
;Public, Supported ICRs
; #2056 - Fileman API - $$GET1^DIQ
;
;
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
N DAY30,LIFETIME,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,DATA
S (LIFETIME,DAY30,PHYSICAL,INTERP,INTRAP,IMPULSE,SOCIAL)=0
F I=3:1:33 S DATA(I-2)=YSDATA(I)
F I=1:2:30 Q:'$D(DATA(I)) S LIFETIME=$G(LIFETIME)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=2:2:30 Q:'$D(DATA(I)) S DAY30=$G(DAY30)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=4,14,18 S PHYSICAL=$G(PHYSICAL)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=20,22,30 S INTERP=$G(INTERP)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=2,8,24 S INTRAP=$G(INTRAP)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=10,12,30 S IMPULSE=$G(IMPULSE)+$$GET1^DIQ(601.75,$P(DATA(I),"^",3)_",",4,"I")
F I=6,16,28 S SOCIAL=$G(SOCIAL)+$$GET1^DIQ(601.75,$P(DATA(I),"^",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,5,6,7,8,9,10 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:LIFETIME,I=5:DAY30,I=6:PHYSICAL,I=7:INTERP,I=8:INTRAP,I=9:IMPULSE,1:SOCIAL)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSSIPST 1870 printed Nov 22, 2024@17:30:53 Page 2
YTSSIPST ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR SHORT INVENTORY OF PROBLEMS - AD (SIP-AD-START)
+1 ;;5.01;MENTAL HEALTH;**150**;DEC 30,1994;Build 210
+2 ;
+3 ;Public, Supported ICRs
+4 ; #2056 - Fileman API - $$GET1^DIQ
+5 ;
+6 ;
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
+4 NEW DAY30,LIFETIME,IMPULSE,SOCIAL
+5 ;
+6 ; CMQ 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 ;
+2 ;
+3 QUIT
+4 ;
DATA1 ;
+1 ;
+2 NEW I,II,DATA
+3 SET (LIFETIME,DAY30,PHYSICAL,INTERP,INTRAP,IMPULSE,SOCIAL)=0
+4 FOR I=3:1:33
SET DATA(I-2)=YSDATA(I)
+5 FOR I=1:2:30
if '$DATA(DATA(I))
QUIT
SET LIFETIME=$GET(LIFETIME)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+6 FOR I=2:2:30
if '$DATA(DATA(I))
QUIT
SET DAY30=$GET(DAY30)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+7 FOR I=4,14,18
SET PHYSICAL=$GET(PHYSICAL)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+8 FOR I=20,22,30
SET INTERP=$GET(INTERP)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+9 FOR I=2,8,24
SET INTRAP=$GET(INTRAP)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+10 FOR I=10,12,30
SET IMPULSE=$GET(IMPULSE)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+11 FOR I=6,16,28
SET SOCIAL=$GET(SOCIAL)+$$GET1^DIQ(601.75,$PIECE(DATA(I),"^",3)_",",4,"I")
+12 ;
+13 QUIT
+14 ;
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 FOR I=3,5,6,7,8,9,10
Begin DoDot:1
+12 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",I),"^",1),"=",2)
+13 SET ^TMP($JOB,"YSCOR",I)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$SELECT(I=3:LIFETIME,I=5:DAY30,I=6:PHYSICAL,I=7:INTERP,I=8:INTRAP,I=9:IMPULSE,1:SOCIAL)
End DoDot:1
+14 QUIT
+15 ;