YTSFOCI ;SLC/BLD - Score for The Florida Obsessive Compulsive Inventory (FOCI) ; 4/16/2019
;;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
N YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCR,I,TOTSCR2
N YSSCALIEN1,YSSCGROUP1,YSSCNAM2
;
; 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 ;
;
S (TOTSCR,TOTSCR2)=0
F I=3:1:22 Q:'$D(YSDATA(I)) S TOTSCR=$G(TOTSCR)+$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")
F I=23:1:27 Q:'$D(YSDATA(I)) S TOTSCR2=$G(TOTSCR2)+$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I")
;
S YSSCGROUP=$P($P(^TMP($J,"YSG",2),"^",1),"=",2)
S YSSCALIEN=$P($P(^TMP($J,"YSG",3),"^",1),"=",2)
S YSSCGROUP1=$P($P(^TMP($J,"YSG",4),"^",1),"=",2)
S YSSCALIEN1=$P($P(^TMP($J,"YSG",5),"^",1),"=",2)
Q
;
SCORESV ;
N YSSCGROUP
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
S YSSCNAM2=$P($G(^TMP($J,"YSG",5)),U,4) ; Scale Name
;
K ^TMP($J,"YSCOR")
;
S ^TMP($J,"YSCOR",1)="[DATA]"
S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_+$FN(TOTSCR,"",2)
S ^TMP($J,"YSCOR",3)=$$GET1^DIQ(601.87,YSSCALIEN1_",",3,"I")_"="_+$FN(TOTSCR2,"",2)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSFOCI 1703 printed Dec 13, 2024@02:19:50 Page 2
YTSFOCI ;SLC/BLD - Score for The Florida Obsessive Compulsive Inventory (FOCI) ; 4/16/2019
+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 NEW DATA,DES,LEG,NODE,YSQN,YSSCALIEN,TOTSCORE,QUES,BASIS
+4 NEW YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCR,I,TOTSCR2
+5 NEW YSSCALIEN1,YSSCGROUP1,YSSCNAM2
+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 SET (TOTSCR,TOTSCR2)=0
+3 FOR I=3:1:22
if '$DATA(YSDATA(I))
QUIT
SET TOTSCR=$GET(TOTSCR)+$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")
+4 FOR I=23:1:27
if '$DATA(YSDATA(I))
QUIT
SET TOTSCR2=$GET(TOTSCR2)+$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")
+5 ;
+6 SET YSSCGROUP=$PIECE($PIECE(^TMP($JOB,"YSG",2),"^",1),"=",2)
+7 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",3),"^",1),"=",2)
+8 SET YSSCGROUP1=$PIECE($PIECE(^TMP($JOB,"YSG",4),"^",1),"=",2)
+9 SET YSSCALIEN1=$PIECE($PIECE(^TMP($JOB,"YSG",5),"^",1),"=",2)
+10 QUIT
+11 ;
SCORESV ;
+1 NEW YSSCGROUP
+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 ; Scale Name
SET YSSCNAM=$PIECE($GET(^TMP($JOB,"YSG",3)),U,4)
+8 ; Scale Name
SET YSSCNAM2=$PIECE($GET(^TMP($JOB,"YSG",5)),U,4)
+9 ;
+10 KILL ^TMP($JOB,"YSCOR")
+11 ;
+12 SET ^TMP($JOB,"YSCOR",1)="[DATA]"
+13 SET ^TMP($JOB,"YSCOR",2)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_+$FNUMBER(TOTSCR,"",2)
+14 SET ^TMP($JOB,"YSCOR",3)=$$GET1^DIQ(601.87,YSSCALIEN1_",",3,"I")_"="_+$FNUMBER(TOTSCR2,"",2)
+15 QUIT
+16 ;