YTSMCMIB ;BAL/KTL- MCMI4 ANSWERS SPECIAL HANDLING - INI ; 9/14/18 3:19pm
;;5.01;MENTAL HEALTH;**151,187**;Dec 30, 1994;Build 73
;
; MCMI4 Scoring
;
; Initialize arrays for scoring MCMI4
;
INICOD ;
;The MH SCALES are entered by name Since the Scale Codes can be cryptic (e.g. Scale Name 'Disclosure' has the Scale Code of 'X')
;However it is overly verbose to index all the arrays by Scale Name therefore we create a xref by NAME of CODE and
;set up the YSCOD array
; YSCOD("NAME",name)=code
; YSCOD("ORDER",name)=display order number
;
N NAM,ORD
S YSCOD("NAME","6A.3 Acting-Out Dynamics")="6A.3"
S YSCOD("NAME","5.3 Admirable Self-Image")="5.3"
S YSCOD("NAME","B Alcohol Use")="B"
S YSCOD("NAME","2A.2 Alienated Self-Image")="2A.2"
S YSCOD("NAME","6A Antisocial")="6A"
S YSCOD("NAME","6A.2 Autonomous Self-Image")="6A.2"
S YSCOD("NAME","2A Avoidant")="2A"
S YSCOD("NAME","N Bipolar Spectrum")="N"
S YSCOD("NAME","C Borderline")="C"
S YSCOD("NAME","S.3 Chaotic Content")="S.3"
S YSCOD("NAME","S.1 Cognitively Circumstantial")="S.1"
S YSCOD("NAME","7.2 Cognitively Constricted")="7.2"
S YSCOD("NAME","5.2 Cognitively Expansive")="5.2"
S YSCOD("NAME","2B.1 Cognitively Fatalistic")="2B.1"
S YSCOD("NAME","P.2 Cognitively Mistrustful")="P.2"
S YSCOD("NAME","7 Compulsive")="7"
S YSCOD("NAME","PP Delusional")="PP"
S YSCOD("NAME","3 Dependent")="3"
S YSCOD("NAME","8A.2 Discontented Self-Image")="8A.2"
S YSCOD("NAME","T Drug Use")="T"
S YSCOD("NAME","6B.3 Eruptive Architecture")="6B.3"
S YSCOD("NAME","S.2 Estranged Self-Image")="S.2"
S YSCOD("NAME","4B.3 Exalted Self-Image")="4B.3"
S YSCOD("NAME","P.1 Expressively Defensive")="P.1"
S YSCOD("NAME","7.1 Expressively Disciplined")="7.1"
S YSCOD("NAME","4A.1 Expressively Dramatic")="4A.1"
S YSCOD("NAME","8A.1 Expressively Embittered")="8A.1"
S YSCOD("NAME","4B.1 Expressively Impetuous")="4B.1"
S YSCOD("NAME","6B.1 Expressively Precipitate")="6B.1"
S YSCOD("NAME","3.1 Expressively Puerile")="3.1"
S YSCOD("NAME","A Generalized Anxiety")="A"
S YSCOD("NAME","4A Histrionic")="4A"
S YSCOD("NAME","3.3 Inept Self-Image")="3.3"
S YSCOD("NAME","6B.2 Interpersonally Abrasive")="6B.2"
S YSCOD("NAME","4A.2 Interpersonally Attention-Seeking")="4A.2"
S YSCOD("NAME","2A.1 Interpersonally Aversive")="2A.1"
S YSCOD("NAME","5.1 Interpersonally Exploitive")="5.1"
S YSCOD("NAME","4B.2 Interpersonally High-Spirited")="4B.2"
S YSCOD("NAME","6A.1 Interpersonally Irresponsible")="6A.1"
S YSCOD("NAME","3.2 Interpersonally Submissive")="3.2"
S YSCOD("NAME","1.1 Interpersonally Unengaged")="1.1"
S YSCOD("NAME","8B.2 Inverted Architecture")="8B.2"
S YSCOD("NAME","CC Major Depression")="CC"
S YSCOD("NAME","8B Masochistic")="8B"
S YSCOD("NAME","1.2 Meager Content")="1.2"
S YSCOD("NAME","2B Melancholic")="2B"
S YSCOD("NAME","5 Narcissistic")="5"
S YSCOD("NAME","8A Negativistic")="8A"
S YSCOD("NAME","P Paranoid")="P"
S YSCOD("NAME","D Persistent Depression")="D"
S YSCOD("NAME","R Post-Traumatic Stress")="R"
S YSCOD("NAME","P.3 Projection Dynamics")="P.3"
S YSCOD("NAME","7.3 Reliable Self-Image")="7.3"
S YSCOD("NAME","6B Sadistic")="6B"
S YSCOD("NAME","1 Schizoid")="1"
S YSCOD("NAME","SS Schizophrenic Spectrum")="SS"
S YSCOD("NAME","S Schizotypal")="S"
S YSCOD("NAME","H Somatic Symptom")="H"
S YSCOD("NAME","C.2 Split Architecture")="C.2"
S YSCOD("NAME","1.3 Temperamentally Apathetic")="1.3"
S YSCOD("NAME","8B.3 Temperamentally Dysphoric")="8B.3"
S YSCOD("NAME","4A.3 Temperamentally Fickle")="4A.3"
S YSCOD("NAME","8A.3 Temperamentally Irritable")="8A.3"
S YSCOD("NAME","C.3 Temperamentally Labile")="C.3"
S YSCOD("NAME","2B.3 Temperamentally Woeful")="2B.3"
S YSCOD("NAME","4B Turbulent")="4B"
S YSCOD("NAME","C.1 Uncertain Self-Image")="C.1"
S YSCOD("NAME","8B.1 Undeserving Self-Image")="8B.1"
S YSCOD("NAME","2A.3 Vexatious Content")="2A.3"
S YSCOD("NAME","2B.2 Worthless Self-Image")="2B.2"
S YSCOD("NAME","X Disclosure")="X"
S YSCOD("NAME","Y Desirability")="Y"
S YSCOD("NAME","Z Debasement")="Z"
S YSCOD("NAME","V Invalidity")="V"
S YSCOD("NAME","W Inconsistency")="W"
;
S ORD=1 F S ORD=$O(^TMP($J,"YSCOR",ORD)) Q:+ORD=0 D
.S SCAL=$P(^TMP($J,"YSCOR",ORD),"=")
.S YSCOD("ORDER",SCAL)=ORD
Q
YSQ ;
;Initialize array of scales and questions associated with that scale
;MCMI Scales range from 1140-1169,1240-1284 in MH SCALES
N SCALCOD,STR,SCAL,N0,NAM,STR
S SCAL=1139 F S SCAL=$O(^YTT(601.87,SCAL)) Q:SCAL>1169 D
.D YSQ2
S SCAL=1239 F S SCAL=$O(^YTT(601.87,SCAL)) Q:SCAL>1284 D
.D YSQ2
Q
YSQ2 ;
N NN0,SCOR,N0,NAM,QUES,STR
S STR=""
S N0=^YTT(601.87,SCAL,0),NAM=$P(N0,"^",4)
S SCOR="" F S SCOR=$O(^YTT(601.91,"AC",SCAL,SCOR)) Q:SCOR="" D
.S NN0=^YTT(601.91,SCOR,0),QUES=$P(NN0,"^",3),QUES=QUES-8014 ;8015=question#1 so subtract 8014 from QUES
.S STR=STR_QUES_"^"
S STR=$E(STR,1,$L(STR)-1)
S YSQSCAL(NAM)=STR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSMCMIB 4991 printed Dec 13, 2024@02:19:59 Page 2
YTSMCMIB ;BAL/KTL- MCMI4 ANSWERS SPECIAL HANDLING - INI ; 9/14/18 3:19pm
+1 ;;5.01;MENTAL HEALTH;**151,187**;Dec 30, 1994;Build 73
+2 ;
+3 ; MCMI4 Scoring
+4 ;
+5 ; Initialize arrays for scoring MCMI4
+6 ;
INICOD ;
+1 ;The MH SCALES are entered by name Since the Scale Codes can be cryptic (e.g. Scale Name 'Disclosure' has the Scale Code of 'X')
+2 ;However it is overly verbose to index all the arrays by Scale Name therefore we create a xref by NAME of CODE and
+3 ;set up the YSCOD array
+4 ; YSCOD("NAME",name)=code
+5 ; YSCOD("ORDER",name)=display order number
+6 ;
+7 NEW NAM,ORD
+8 SET YSCOD("NAME","6A.3 Acting-Out Dynamics")="6A.3"
+9 SET YSCOD("NAME","5.3 Admirable Self-Image")="5.3"
+10 SET YSCOD("NAME","B Alcohol Use")="B"
+11 SET YSCOD("NAME","2A.2 Alienated Self-Image")="2A.2"
+12 SET YSCOD("NAME","6A Antisocial")="6A"
+13 SET YSCOD("NAME","6A.2 Autonomous Self-Image")="6A.2"
+14 SET YSCOD("NAME","2A Avoidant")="2A"
+15 SET YSCOD("NAME","N Bipolar Spectrum")="N"
+16 SET YSCOD("NAME","C Borderline")="C"
+17 SET YSCOD("NAME","S.3 Chaotic Content")="S.3"
+18 SET YSCOD("NAME","S.1 Cognitively Circumstantial")="S.1"
+19 SET YSCOD("NAME","7.2 Cognitively Constricted")="7.2"
+20 SET YSCOD("NAME","5.2 Cognitively Expansive")="5.2"
+21 SET YSCOD("NAME","2B.1 Cognitively Fatalistic")="2B.1"
+22 SET YSCOD("NAME","P.2 Cognitively Mistrustful")="P.2"
+23 SET YSCOD("NAME","7 Compulsive")="7"
+24 SET YSCOD("NAME","PP Delusional")="PP"
+25 SET YSCOD("NAME","3 Dependent")="3"
+26 SET YSCOD("NAME","8A.2 Discontented Self-Image")="8A.2"
+27 SET YSCOD("NAME","T Drug Use")="T"
+28 SET YSCOD("NAME","6B.3 Eruptive Architecture")="6B.3"
+29 SET YSCOD("NAME","S.2 Estranged Self-Image")="S.2"
+30 SET YSCOD("NAME","4B.3 Exalted Self-Image")="4B.3"
+31 SET YSCOD("NAME","P.1 Expressively Defensive")="P.1"
+32 SET YSCOD("NAME","7.1 Expressively Disciplined")="7.1"
+33 SET YSCOD("NAME","4A.1 Expressively Dramatic")="4A.1"
+34 SET YSCOD("NAME","8A.1 Expressively Embittered")="8A.1"
+35 SET YSCOD("NAME","4B.1 Expressively Impetuous")="4B.1"
+36 SET YSCOD("NAME","6B.1 Expressively Precipitate")="6B.1"
+37 SET YSCOD("NAME","3.1 Expressively Puerile")="3.1"
+38 SET YSCOD("NAME","A Generalized Anxiety")="A"
+39 SET YSCOD("NAME","4A Histrionic")="4A"
+40 SET YSCOD("NAME","3.3 Inept Self-Image")="3.3"
+41 SET YSCOD("NAME","6B.2 Interpersonally Abrasive")="6B.2"
+42 SET YSCOD("NAME","4A.2 Interpersonally Attention-Seeking")="4A.2"
+43 SET YSCOD("NAME","2A.1 Interpersonally Aversive")="2A.1"
+44 SET YSCOD("NAME","5.1 Interpersonally Exploitive")="5.1"
+45 SET YSCOD("NAME","4B.2 Interpersonally High-Spirited")="4B.2"
+46 SET YSCOD("NAME","6A.1 Interpersonally Irresponsible")="6A.1"
+47 SET YSCOD("NAME","3.2 Interpersonally Submissive")="3.2"
+48 SET YSCOD("NAME","1.1 Interpersonally Unengaged")="1.1"
+49 SET YSCOD("NAME","8B.2 Inverted Architecture")="8B.2"
+50 SET YSCOD("NAME","CC Major Depression")="CC"
+51 SET YSCOD("NAME","8B Masochistic")="8B"
+52 SET YSCOD("NAME","1.2 Meager Content")="1.2"
+53 SET YSCOD("NAME","2B Melancholic")="2B"
+54 SET YSCOD("NAME","5 Narcissistic")="5"
+55 SET YSCOD("NAME","8A Negativistic")="8A"
+56 SET YSCOD("NAME","P Paranoid")="P"
+57 SET YSCOD("NAME","D Persistent Depression")="D"
+58 SET YSCOD("NAME","R Post-Traumatic Stress")="R"
+59 SET YSCOD("NAME","P.3 Projection Dynamics")="P.3"
+60 SET YSCOD("NAME","7.3 Reliable Self-Image")="7.3"
+61 SET YSCOD("NAME","6B Sadistic")="6B"
+62 SET YSCOD("NAME","1 Schizoid")="1"
+63 SET YSCOD("NAME","SS Schizophrenic Spectrum")="SS"
+64 SET YSCOD("NAME","S Schizotypal")="S"
+65 SET YSCOD("NAME","H Somatic Symptom")="H"
+66 SET YSCOD("NAME","C.2 Split Architecture")="C.2"
+67 SET YSCOD("NAME","1.3 Temperamentally Apathetic")="1.3"
+68 SET YSCOD("NAME","8B.3 Temperamentally Dysphoric")="8B.3"
+69 SET YSCOD("NAME","4A.3 Temperamentally Fickle")="4A.3"
+70 SET YSCOD("NAME","8A.3 Temperamentally Irritable")="8A.3"
+71 SET YSCOD("NAME","C.3 Temperamentally Labile")="C.3"
+72 SET YSCOD("NAME","2B.3 Temperamentally Woeful")="2B.3"
+73 SET YSCOD("NAME","4B Turbulent")="4B"
+74 SET YSCOD("NAME","C.1 Uncertain Self-Image")="C.1"
+75 SET YSCOD("NAME","8B.1 Undeserving Self-Image")="8B.1"
+76 SET YSCOD("NAME","2A.3 Vexatious Content")="2A.3"
+77 SET YSCOD("NAME","2B.2 Worthless Self-Image")="2B.2"
+78 SET YSCOD("NAME","X Disclosure")="X"
+79 SET YSCOD("NAME","Y Desirability")="Y"
+80 SET YSCOD("NAME","Z Debasement")="Z"
+81 SET YSCOD("NAME","V Invalidity")="V"
+82 SET YSCOD("NAME","W Inconsistency")="W"
+83 ;
+84 SET ORD=1
FOR
SET ORD=$ORDER(^TMP($JOB,"YSCOR",ORD))
if +ORD=0
QUIT
Begin DoDot:1
+85 SET SCAL=$PIECE(^TMP($JOB,"YSCOR",ORD),"=")
+86 SET YSCOD("ORDER",SCAL)=ORD
End DoDot:1
+87 QUIT
YSQ ;
+1 ;Initialize array of scales and questions associated with that scale
+2 ;MCMI Scales range from 1140-1169,1240-1284 in MH SCALES
+3 NEW SCALCOD,STR,SCAL,N0,NAM,STR
+4 SET SCAL=1139
FOR
SET SCAL=$ORDER(^YTT(601.87,SCAL))
if SCAL>1169
QUIT
Begin DoDot:1
+5 DO YSQ2
End DoDot:1
+6 SET SCAL=1239
FOR
SET SCAL=$ORDER(^YTT(601.87,SCAL))
if SCAL>1284
QUIT
Begin DoDot:1
+7 DO YSQ2
End DoDot:1
+8 QUIT
YSQ2 ;
+1 NEW NN0,SCOR,N0,NAM,QUES,STR
+2 SET STR=""
+3 SET N0=^YTT(601.87,SCAL,0)
SET NAM=$PIECE(N0,"^",4)
+4 SET SCOR=""
FOR
SET SCOR=$ORDER(^YTT(601.91,"AC",SCAL,SCOR))
if SCOR=""
QUIT
Begin DoDot:1
+5 ;8015=question#1 so subtract 8014 from QUES
SET NN0=^YTT(601.91,SCOR,0)
SET QUES=$PIECE(NN0,"^",3)
SET QUES=QUES-8014
+6 SET STR=STR_QUES_"^"
End DoDot:1
+7 SET STR=$EXTRACT(STR,1,$LENGTH(STR)-1)
+8 SET YSQSCAL(NAM)=STR
+9 QUIT