- YTSSWEM ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR SWEMWBS
- ;;5.01;MENTAL HEALTH;**150,172**;DEC 30,1994;Build 10
- ;
- ;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,METARRAY
- ;
- ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
- I YSTRNG=1 D METRIC(.METARRAY),SCORESV Q
- I YSTRNG=2 Q ;D
- ;
- Q
- ;
- STRING ;
- Q
- ;
- DATA1 ;
- ;
- N I,II
- S TOTSCORE=0,II=1
- F I=3:1:9 S TOTSCORE(II)=$$GET1^DIQ(601.75,$P(YSDATA(I),"^",3)_",",4,"I"),II=II+1
- F I=1:1 S TOTSCORE=$G(TOTSCORE)+$G(TOTSCORE(I)) Q:'$D(TOTSCORE(I))
- Q
- ;
- SCORESV ;
- N YSSCGROUP,II,J
- 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 II=1,J=1
- F I=3:1:9 D
- .S YSSCALIEN=$P($P(^TMP($J,"YSG",I),"^",1),"=",2)
- .S J=J+1,^TMP($J,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FN(TOTSCORE(II),"",2),II=II+1
- S YSSCALIEN=$P($P(^TMP($J,"YSG",10),"^",1),"=",2)
- S J=J+1,^TMP($J,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FN(METARRAY(TOTSCORE),"",2)
- Q
- ;
- METRIC(METARRAY) ;
- ;
- S METARRAY(7)="7.00"
- S METARRAY(8)=9.51
- S METARRAY(9)=11.25
- S METARRAY(10)=12.40
- S METARRAY(11)=13.33
- S METARRAY(12)=14.08
- S METARRAY(13)=14.75
- S METARRAY(14)=15.32
- S METARRAY(15)=15.84
- S METARRAY(16)=16.36
- S METARRAY(17)=16.88
- S METARRAY(18)=17.43
- S METARRAY(19)=17.98
- S METARRAY(20)=18.59
- S METARRAY(21)=19.25
- S METARRAY(22)=19.98
- S METARRAY(23)=20.73
- S METARRAY(24)=21.54
- S METARRAY(25)=22.35
- S METARRAY(26)=23.21
- S METARRAY(27)=24.11
- S METARRAY(28)=25.03
- S METARRAY(29)=26.02
- S METARRAY(30)=27.03
- S METARRAY(31)=28.13
- S METARRAY(32)=29.31
- S METARRAY(33)=30.70
- S METARRAY(34)=32.55
- S METARRAY(35)="35.00"
- Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSSWEM 2148 printed Jan 18, 2025@03:22:04 Page 2
- YTSSWEM ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING FOR SWEMWBS
- +1 ;;5.01;MENTAL HEALTH;**150,172**;DEC 30,1994;Build 10
- +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
- +4 NEW YSCDA,YSSCNAM,YSINSNAM,STRING,STRING1,TOTSCORE,METARRAY
- +5 ;
- +6 ; Basis-24 Psychosis returns a scale score which is calculated and stored, no special text in report
- +7 IF YSTRNG=1
- DO METRIC(.METARRAY)
- DO SCORESV
- QUIT
- +8 ;D
- IF YSTRNG=2
- QUIT
- +9 ;
- +10 QUIT
- +11 ;
- STRING ;
- +1 QUIT
- +2 ;
- DATA1 ;
- +1 ;
- +2 NEW I,II
- +3 SET TOTSCORE=0
- SET II=1
- +4 FOR I=3:1:9
- SET TOTSCORE(II)=$$GET1^DIQ(601.75,$PIECE(YSDATA(I),"^",3)_",",4,"I")
- SET II=II+1
- +5 FOR I=1:1
- SET TOTSCORE=$GET(TOTSCORE)+$GET(TOTSCORE(I))
- if '$DATA(TOTSCORE(I))
- QUIT
- +6 QUIT
- +7 ;
- SCORESV ;
- +1 NEW YSSCGROUP,II,J
- +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 II=1
- SET J=1
- +12 FOR I=3:1:9
- Begin DoDot:1
- +13 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",I),"^",1),"=",2)
- +14 SET J=J+1
- SET ^TMP($JOB,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FNUMBER(TOTSCORE(II),"",2)
- SET II=II+1
- End DoDot:1
- +15 SET YSSCALIEN=$PIECE($PIECE(^TMP($JOB,"YSG",10),"^",1),"=",2)
- +16 SET J=J+1
- SET ^TMP($JOB,"YSCOR",J)=$$GET1^DIQ(601.87,YSSCALIEN_",",3,"I")_"="_$FNUMBER(METARRAY(TOTSCORE),"",2)
- +17 QUIT
- +18 ;
- METRIC(METARRAY) ;
- +1 ;
- +2 SET METARRAY(7)="7.00"
- +3 SET METARRAY(8)=9.51
- +4 SET METARRAY(9)=11.25
- +5 SET METARRAY(10)=12.40
- +6 SET METARRAY(11)=13.33
- +7 SET METARRAY(12)=14.08
- +8 SET METARRAY(13)=14.75
- +9 SET METARRAY(14)=15.32
- +10 SET METARRAY(15)=15.84
- +11 SET METARRAY(16)=16.36
- +12 SET METARRAY(17)=16.88
- +13 SET METARRAY(18)=17.43
- +14 SET METARRAY(19)=17.98
- +15 SET METARRAY(20)=18.59
- +16 SET METARRAY(21)=19.25
- +17 SET METARRAY(22)=19.98
- +18 SET METARRAY(23)=20.73
- +19 SET METARRAY(24)=21.54
- +20 SET METARRAY(25)=22.35
- +21 SET METARRAY(26)=23.21
- +22 SET METARRAY(27)=24.11
- +23 SET METARRAY(28)=25.03
- +24 SET METARRAY(29)=26.02
- +25 SET METARRAY(30)=27.03
- +26 SET METARRAY(31)=28.13
- +27 SET METARRAY(32)=29.31
- +28 SET METARRAY(33)=30.70
- +29 SET METARRAY(34)=32.55
- +30 SET METARRAY(35)="35.00"
- +31 QUIT
- +32 ;