YTSMHRM ;SLC/BLD- MHRM-10 ANSWERS SPECIAL HANDLING FOR MHRM-10
;;5.01;MENTAL HEALTH;**150**;DEC 30,1994;Build 210
;
;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
;
; 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 ;
;
N I,II
S TOTSCORE=0,II=1
F I=3:1 Q:'$D(YSDATA(I)) S TOTSCORE=TOTSCORE+$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")
;F I=1:1 Q:'$D(TOTSCORE(I)) S TOTSCORE=$G(TOTSCORE)+$G(TOTSCORE(I)) Q:'$D(TOTSCORE(I))
Q
;
SCORESV ;
N YSSCGROUP,I,II
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
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSMHRM 1251 printed Dec 13, 2024@02:20:04 Page 2
YTSMHRM ;SLC/BLD- MHRM-10 ANSWERS SPECIAL HANDLING FOR MHRM-10
+1 ;;5.01;MENTAL HEALTH;**150**;DEC 30,1994;Build 210
+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 ;
+4 NEW DATA,DES,LEG,NODE,YSQN,YSSCALIEN,TOTSCORE,QUES,BASIS,TOTSCR
+5 NEW YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCORE
+6 ;
+7 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
+8 IF YSTRNG=1
DO SCORESV
QUIT
+9 ;D
IF YSTRNG=2
QUIT
+10 ;
+11 QUIT
+12 ;
STRING ;
+1 QUIT
+2 ;
DATA1 ;
+1 ;
+2 NEW I,II
+3 SET TOTSCORE=0
SET II=1
+4 FOR I=3:1
if '$DATA(YSDATA(I))
QUIT
SET TOTSCORE=TOTSCORE+$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")
+5 ;F I=1:1 Q:'$D(TOTSCORE(I)) S TOTSCORE=$G(TOTSCORE)+$G(TOTSCORE(I)) Q:'$D(TOTSCORE(I))
+6 QUIT
+7 ;
SCORESV ;
+1 NEW YSSCGROUP,I,II
+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 ;