YTSMPI2 ;SLC/PIJ - Score MMPI-2-RF ; 01/08/2016
;;5.01;MENTAL HEALTH;**123**;DEC 30,1994;Build 73
;
;Public, Supported ICRs
; #2056 - Fileman API - $$GET1^DIQ
;
Q
;
DATA1 ; Use YSDATA to put responses in Sequence order to utilize previously writen code
; This approach is different from other instruments which use Legacy Values and designator
N NODE,I,SEQ,QNUM
S YSINSNAM=$P($G(YSDATA(2)),U,3)
I $G(YSINSNAM)="" S YSINSNAM=$G(YS("CODE"),"NO NAME PASSED")
S NODE=2 F S NODE=$O(YSDATA(NODE)) Q:NODE="" D ; Start at YSDATA(3)
. S SEQ($P(YSDATA(NODE),U,2),NODE)=$P(^YTT(601.75,$P(YSDATA(NODE),U,3),0),U,2)
S QNUM=0
S SEQ=0 F S SEQ=$O(SEQ(SEQ)) Q:'SEQ S I=0 F S I=$O(SEQ(SEQ,I)) Q:'I D
.S QNUM=QNUM+1,RSP(QNUM)=SEQ(SEQ,I)
.I RSP(QNUM)="X" S RSP(QNUM)="",CANTSAY=CANTSAY_QNUM_", "
.I $L(CANTSAY)>55,($L(CANTSAY,"|")'>1) S CANTSAY=CANTSAY_"|"
.I $L(CANTSAY)>170 S CANTSAY=CANTSAY_"|"
.I $L(CANTSAY)>255 S CANTSAY=CANTSAY_"|"
I $E(CANTSAY,$L(CANTSAY)-1)="," S CANTSAY=$E(CANTSAY,1,$L(CANTSAY)-2)
Q
;
SCORE ;
F SCALE="VRIN-r","TRIN-r","F-r","Fp-r","Fs","FBS-r","RBS","L-r","K-r" D
.D SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
F SCALE="EID","THD","BXD","RCd","RC1","RC2","RC3","RC4","RC6","RC7","RC8","RC9" D
.D SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
F SCALE="MLS","HPC","NUC","GIC","SUI","HLP","SFD","NFC","COG","STW","AXY","ANP","BRF","MSF" D
.D SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
F SCALE="JCP","SUB","AGG","ACT","FML","IPP","SAV","SHY","DSF","AES","MEC" D
.D SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
F SCALE="AGGR","PSYC","DISC","NEGE","INTR" D
.D SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
Q
;
SCORESV ;
;
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)=YSINSNAM_" Scale not found"
;
K ^TMP($J,"YSCOR")
S ^TMP($J,"YSCOR",1)="[DATA]"
; MMPI-2-RF^Validity
; SCR(SCALE)=RAW^TSCORE^PERCENT_ANSWERED^COUNT
S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,706_",",3,"I")_"="_SCR("VRIN-r") ; VRIN
S ^TMP($J,"YSCOR",3)=$$GET1^DIQ(601.87,707_",",3,"I")_"="_SCR("TRIN-r") ;TRIN
S ^TMP($J,"YSCOR",4)=$$GET1^DIQ(601.87,709_",",3,"I")_"="_SCR("F-r")
S ^TMP($J,"YSCOR",5)=$$GET1^DIQ(601.87,710_",",3,"I")_"="_SCR("Fp-r")
S ^TMP($J,"YSCOR",6)=$$GET1^DIQ(601.87,711_",",3,"I")_"="_SCR("Fs")
S ^TMP($J,"YSCOR",7)=$$GET1^DIQ(601.87,712_",",3,"I")_"="_SCR("FBS-r")
S ^TMP($J,"YSCOR",8)=$$GET1^DIQ(601.87,713_",",3,"I")_"="_SCR("RBS")
S ^TMP($J,"YSCOR",9)=$$GET1^DIQ(601.87,714_",",3,"I")_"="_SCR("L-r")
S ^TMP($J,"YSCOR",10)=$$GET1^DIQ(601.87,715_",",3,"I")_"="_SCR("K-r")
; MMPI-2-RF^Higher-Order
S ^TMP($J,"YSCOR",11)=$$GET1^DIQ(601.87,708_",",3,"I")_"="_SCR("EID")
S ^TMP($J,"YSCOR",12)=$$GET1^DIQ(601.87,718_",",3,"I")_"="_SCR("THD")
S ^TMP($J,"YSCOR",13)=$$GET1^DIQ(601.87,719_",",3,"I")_"="_SCR("BXD")
; MMPI-2-RF^Restructured Clinical
S ^TMP($J,"YSCOR",14)=$$GET1^DIQ(601.87,730_",",3,"I")_"="_SCR("RCd")
S ^TMP($J,"YSCOR",15)=$$GET1^DIQ(601.87,731_",",3,"I")_"="_SCR("RC1")
S ^TMP($J,"YSCOR",16)=$$GET1^DIQ(601.87,722_",",3,"I")_"="_SCR("RC2")
S ^TMP($J,"YSCOR",17)=$$GET1^DIQ(601.87,723_",",3,"I")_"="_SCR("RC3")
S ^TMP($J,"YSCOR",18)=$$GET1^DIQ(601.87,724_",",3,"I")_"="_SCR("RC4")
S ^TMP($J,"YSCOR",19)=$$GET1^DIQ(601.87,725_",",3,"I")_"="_SCR("RC6")
S ^TMP($J,"YSCOR",20)=$$GET1^DIQ(601.87,726_",",3,"I")_"="_SCR("RC7")
S ^TMP($J,"YSCOR",21)=$$GET1^DIQ(601.87,727_",",3,"I")_"="_SCR("RC8")
S ^TMP($J,"YSCOR",22)=$$GET1^DIQ(601.87,728_",",3,"I")_"="_SCR("RC9")
; MMPI-2-RF^Somatic/Cognitive
S ^TMP($J,"YSCOR",23)=$$GET1^DIQ(601.87,732_",",3,"I")_"="_SCR("MLS")
S ^TMP($J,"YSCOR",24)=$$GET1^DIQ(601.87,733_",",3,"I")_"="_SCR("GIC")
S ^TMP($J,"YSCOR",25)=$$GET1^DIQ(601.87,734_",",3,"I")_"="_SCR("HPC")
S ^TMP($J,"YSCOR",26)=$$GET1^DIQ(601.87,735_",",3,"I")_"="_SCR("NUC")
S ^TMP($J,"YSCOR",27)=$$GET1^DIQ(601.87,736_",",3,"I")_"="_SCR("COG")
; MMPI-2-RF^Internalizing
S ^TMP($J,"YSCOR",28)=$$GET1^DIQ(601.87,737_",",3,"I")_"="_SCR("SUI")
S ^TMP($J,"YSCOR",29)=$$GET1^DIQ(601.87,738_",",3,"I")_"="_SCR("HLP")
S ^TMP($J,"YSCOR",30)=$$GET1^DIQ(601.87,739_",",3,"I")_"="_SCR("SFD")
S ^TMP($J,"YSCOR",31)=$$GET1^DIQ(601.87,740_",",3,"I")_"="_SCR("NFC")
S ^TMP($J,"YSCOR",32)=$$GET1^DIQ(601.87,741_",",3,"I")_"="_SCR("STW")
S ^TMP($J,"YSCOR",33)=$$GET1^DIQ(601.87,742_",",3,"I")_"="_SCR("AXY")
S ^TMP($J,"YSCOR",34)=$$GET1^DIQ(601.87,743_",",3,"I")_"="_SCR("ANP")
S ^TMP($J,"YSCOR",35)=$$GET1^DIQ(601.87,744_",",3,"I")_"="_SCR("BRF")
S ^TMP($J,"YSCOR",36)=$$GET1^DIQ(601.87,745_",",3,"I")_"="_SCR("MSF")
; MMPI-2-RF^Externalizing
S ^TMP($J,"YSCOR",37)=$$GET1^DIQ(601.87,746_",",3,"I")_"="_SCR("JCP")
S ^TMP($J,"YSCOR",38)=$$GET1^DIQ(601.87,747_",",3,"I")_"="_SCR("SUB")
S ^TMP($J,"YSCOR",39)=$$GET1^DIQ(601.87,748_",",3,"I")_"="_SCR("AGG")
S ^TMP($J,"YSCOR",40)=$$GET1^DIQ(601.87,749_",",3,"I")_"="_SCR("ACT")
; MMPI-2-RF^Interpersonal
S ^TMP($J,"YSCOR",41)=$$GET1^DIQ(601.87,752_",",3,"I")_"="_SCR("FML")
S ^TMP($J,"YSCOR",42)=$$GET1^DIQ(601.87,753_",",3,"I")_"="_SCR("IPP")
S ^TMP($J,"YSCOR",43)=$$GET1^DIQ(601.87,754_",",3,"I")_"="_SCR("SAV")
S ^TMP($J,"YSCOR",44)=$$GET1^DIQ(601.87,755_",",3,"I")_"="_SCR("SHY")
S ^TMP($J,"YSCOR",45)=$$GET1^DIQ(601.87,756_",",3,"I")_"="_SCR("DSF")
; MMPI-2-RF^Interest
S ^TMP($J,"YSCOR",46)=$$GET1^DIQ(601.87,750_",",3,"I")_"="_SCR("AES")
S ^TMP($J,"YSCOR",47)=$$GET1^DIQ(601.87,751_",",3,"I")_"="_SCR("MEC")
; MMPI-2-RF^Personality Psychopathology
S ^TMP($J,"YSCOR",48)=$$GET1^DIQ(601.87,757_",",3,"I")_"="_SCR("AGGR")
S ^TMP($J,"YSCOR",49)=$$GET1^DIQ(601.87,758_",",3,"I")_"="_SCR("PSYC")
S ^TMP($J,"YSCOR",50)=$$GET1^DIQ(601.87,759_",",3,"I")_"="_SCR("DISC")
S ^TMP($J,"YSCOR",51)=$$GET1^DIQ(601.87,760_",",3,"I")_"="_SCR("NEGE")
S ^TMP($J,"YSCOR",52)=$$GET1^DIQ(601.87,761_",",3,"I")_"="_SCR("INTR")
Q
;
DLLSTR(YSDATA,YS,YSTRNG) ;
; YSTRNG = 1 Score Instrument
; YSTRNG = 2 get Report Answers and Text
N CANTSAY,CNT,DASHES,RSP,RSLT,SCALE,SCR,TSARR,TXT,YSINSNAM,YSAD
S RSLT="",CNT="",SCR="",CANTSAY=""
;
D DATA1
D SCAN^YTSMPIR(.CNT,.RSP)
;
I YSTRNG=1 D
.D BLDRAW^YTSMPIRD
.D SCORE
.D SCORESV
;
I YSTRNG=2 D
.K TSARR
.S TXT="",TSARR("NOADM")=""
.S YSAD=YS("AD")
.; special call to get RESULTS since there are TRANSFORMED values
.D LDTSCOR^YTSCORE(.TSARR,YSAD)
.I TSARR("NOADM")="" D
..D PROGNOTE^YTSMPI2P
.S YSDATA($O(YSDATA(""),-1)+1)=999999999999_U_U_$S(TSARR("NOADM")'="":TSARR("NOADM"),1:TXT)
K T,K2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTSMPI2 6546 printed Dec 13, 2024@02:20:12 Page 2
YTSMPI2 ;SLC/PIJ - Score MMPI-2-RF ; 01/08/2016
+1 ;;5.01;MENTAL HEALTH;**123**;DEC 30,1994;Build 73
+2 ;
+3 ;Public, Supported ICRs
+4 ; #2056 - Fileman API - $$GET1^DIQ
+5 ;
+6 QUIT
+7 ;
DATA1 ; Use YSDATA to put responses in Sequence order to utilize previously writen code
+1 ; This approach is different from other instruments which use Legacy Values and designator
+2 NEW NODE,I,SEQ,QNUM
+3 SET YSINSNAM=$PIECE($GET(YSDATA(2)),U,3)
+4 IF $GET(YSINSNAM)=""
SET YSINSNAM=$GET(YS("CODE"),"NO NAME PASSED")
+5 ; Start at YSDATA(3)
SET NODE=2
FOR
SET NODE=$ORDER(YSDATA(NODE))
if NODE=""
QUIT
Begin DoDot:1
+6 SET SEQ($PIECE(YSDATA(NODE),U,2),NODE)=$PIECE(^YTT(601.75,$PIECE(YSDATA(NODE),U,3),0),U,2)
End DoDot:1
+7 SET QNUM=0
+8 SET SEQ=0
FOR
SET SEQ=$ORDER(SEQ(SEQ))
if 'SEQ
QUIT
SET I=0
FOR
SET I=$ORDER(SEQ(SEQ,I))
if 'I
QUIT
Begin DoDot:1
+9 SET QNUM=QNUM+1
SET RSP(QNUM)=SEQ(SEQ,I)
+10 IF RSP(QNUM)="X"
SET RSP(QNUM)=""
SET CANTSAY=CANTSAY_QNUM_", "
+11 IF $LENGTH(CANTSAY)>55
IF ($LENGTH(CANTSAY,"|")'>1)
SET CANTSAY=CANTSAY_"|"
+12 IF $LENGTH(CANTSAY)>170
SET CANTSAY=CANTSAY_"|"
+13 IF $LENGTH(CANTSAY)>255
SET CANTSAY=CANTSAY_"|"
End DoDot:1
+14 IF $EXTRACT(CANTSAY,$LENGTH(CANTSAY)-1)=","
SET CANTSAY=$EXTRACT(CANTSAY,1,$LENGTH(CANTSAY)-2)
+15 QUIT
+16 ;
SCORE ;
+1 FOR SCALE="VRIN-r","TRIN-r","F-r","Fp-r","Fs","FBS-r","RBS","L-r","K-r"
Begin DoDot:1
+2 DO SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
End DoDot:1
+3 FOR SCALE="EID","THD","BXD","RCd","RC1","RC2","RC3","RC4","RC6","RC7","RC8","RC9"
Begin DoDot:1
+4 DO SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
End DoDot:1
+5 FOR SCALE="MLS","HPC","NUC","GIC","SUI","HLP","SFD","NFC","COG","STW","AXY","ANP","BRF","MSF"
Begin DoDot:1
+6 DO SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
End DoDot:1
+7 FOR SCALE="JCP","SUB","AGG","ACT","FML","IPP","SAV","SHY","DSF","AES","MEC"
Begin DoDot:1
+8 DO SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
End DoDot:1
+9 FOR SCALE="AGGR","PSYC","DISC","NEGE","INTR"
Begin DoDot:1
+10 DO SCORE1^YTSMPIR(.RSLT,SCALE,.RSP)
End DoDot:1
+11 QUIT
+12 ;
SCORESV ;
+1 ;
+2 ;-->out
IF $DATA(^TMP($JOB,"YSG",1))
IF ^TMP($JOB,"YSG",1)="[ERROR]"
Begin DoDot:1
+3 KILL ^TMP($JOB,"YSCOR")
+4 SET ^TMP($JOB,"YSCOR",1)="[ERROR]"
+5 SET ^TMP($JOB,"YSCOR",2)=YSINSNAM_" Scale not found"
End DoDot:1
QUIT
+6 ;
+7 KILL ^TMP($JOB,"YSCOR")
+8 SET ^TMP($JOB,"YSCOR",1)="[DATA]"
+9 ; MMPI-2-RF^Validity
+10 ; SCR(SCALE)=RAW^TSCORE^PERCENT_ANSWERED^COUNT
+11 ; VRIN
SET ^TMP($JOB,"YSCOR",2)=$$GET1^DIQ(601.87,706_",",3,"I")_"="_SCR("VRIN-r")
+12 ;TRIN
SET ^TMP($JOB,"YSCOR",3)=$$GET1^DIQ(601.87,707_",",3,"I")_"="_SCR("TRIN-r")
+13 SET ^TMP($JOB,"YSCOR",4)=$$GET1^DIQ(601.87,709_",",3,"I")_"="_SCR("F-r")
+14 SET ^TMP($JOB,"YSCOR",5)=$$GET1^DIQ(601.87,710_",",3,"I")_"="_SCR("Fp-r")
+15 SET ^TMP($JOB,"YSCOR",6)=$$GET1^DIQ(601.87,711_",",3,"I")_"="_SCR("Fs")
+16 SET ^TMP($JOB,"YSCOR",7)=$$GET1^DIQ(601.87,712_",",3,"I")_"="_SCR("FBS-r")
+17 SET ^TMP($JOB,"YSCOR",8)=$$GET1^DIQ(601.87,713_",",3,"I")_"="_SCR("RBS")
+18 SET ^TMP($JOB,"YSCOR",9)=$$GET1^DIQ(601.87,714_",",3,"I")_"="_SCR("L-r")
+19 SET ^TMP($JOB,"YSCOR",10)=$$GET1^DIQ(601.87,715_",",3,"I")_"="_SCR("K-r")
+20 ; MMPI-2-RF^Higher-Order
+21 SET ^TMP($JOB,"YSCOR",11)=$$GET1^DIQ(601.87,708_",",3,"I")_"="_SCR("EID")
+22 SET ^TMP($JOB,"YSCOR",12)=$$GET1^DIQ(601.87,718_",",3,"I")_"="_SCR("THD")
+23 SET ^TMP($JOB,"YSCOR",13)=$$GET1^DIQ(601.87,719_",",3,"I")_"="_SCR("BXD")
+24 ; MMPI-2-RF^Restructured Clinical
+25 SET ^TMP($JOB,"YSCOR",14)=$$GET1^DIQ(601.87,730_",",3,"I")_"="_SCR("RCd")
+26 SET ^TMP($JOB,"YSCOR",15)=$$GET1^DIQ(601.87,731_",",3,"I")_"="_SCR("RC1")
+27 SET ^TMP($JOB,"YSCOR",16)=$$GET1^DIQ(601.87,722_",",3,"I")_"="_SCR("RC2")
+28 SET ^TMP($JOB,"YSCOR",17)=$$GET1^DIQ(601.87,723_",",3,"I")_"="_SCR("RC3")
+29 SET ^TMP($JOB,"YSCOR",18)=$$GET1^DIQ(601.87,724_",",3,"I")_"="_SCR("RC4")
+30 SET ^TMP($JOB,"YSCOR",19)=$$GET1^DIQ(601.87,725_",",3,"I")_"="_SCR("RC6")
+31 SET ^TMP($JOB,"YSCOR",20)=$$GET1^DIQ(601.87,726_",",3,"I")_"="_SCR("RC7")
+32 SET ^TMP($JOB,"YSCOR",21)=$$GET1^DIQ(601.87,727_",",3,"I")_"="_SCR("RC8")
+33 SET ^TMP($JOB,"YSCOR",22)=$$GET1^DIQ(601.87,728_",",3,"I")_"="_SCR("RC9")
+34 ; MMPI-2-RF^Somatic/Cognitive
+35 SET ^TMP($JOB,"YSCOR",23)=$$GET1^DIQ(601.87,732_",",3,"I")_"="_SCR("MLS")
+36 SET ^TMP($JOB,"YSCOR",24)=$$GET1^DIQ(601.87,733_",",3,"I")_"="_SCR("GIC")
+37 SET ^TMP($JOB,"YSCOR",25)=$$GET1^DIQ(601.87,734_",",3,"I")_"="_SCR("HPC")
+38 SET ^TMP($JOB,"YSCOR",26)=$$GET1^DIQ(601.87,735_",",3,"I")_"="_SCR("NUC")
+39 SET ^TMP($JOB,"YSCOR",27)=$$GET1^DIQ(601.87,736_",",3,"I")_"="_SCR("COG")
+40 ; MMPI-2-RF^Internalizing
+41 SET ^TMP($JOB,"YSCOR",28)=$$GET1^DIQ(601.87,737_",",3,"I")_"="_SCR("SUI")
+42 SET ^TMP($JOB,"YSCOR",29)=$$GET1^DIQ(601.87,738_",",3,"I")_"="_SCR("HLP")
+43 SET ^TMP($JOB,"YSCOR",30)=$$GET1^DIQ(601.87,739_",",3,"I")_"="_SCR("SFD")
+44 SET ^TMP($JOB,"YSCOR",31)=$$GET1^DIQ(601.87,740_",",3,"I")_"="_SCR("NFC")
+45 SET ^TMP($JOB,"YSCOR",32)=$$GET1^DIQ(601.87,741_",",3,"I")_"="_SCR("STW")
+46 SET ^TMP($JOB,"YSCOR",33)=$$GET1^DIQ(601.87,742_",",3,"I")_"="_SCR("AXY")
+47 SET ^TMP($JOB,"YSCOR",34)=$$GET1^DIQ(601.87,743_",",3,"I")_"="_SCR("ANP")
+48 SET ^TMP($JOB,"YSCOR",35)=$$GET1^DIQ(601.87,744_",",3,"I")_"="_SCR("BRF")
+49 SET ^TMP($JOB,"YSCOR",36)=$$GET1^DIQ(601.87,745_",",3,"I")_"="_SCR("MSF")
+50 ; MMPI-2-RF^Externalizing
+51 SET ^TMP($JOB,"YSCOR",37)=$$GET1^DIQ(601.87,746_",",3,"I")_"="_SCR("JCP")
+52 SET ^TMP($JOB,"YSCOR",38)=$$GET1^DIQ(601.87,747_",",3,"I")_"="_SCR("SUB")
+53 SET ^TMP($JOB,"YSCOR",39)=$$GET1^DIQ(601.87,748_",",3,"I")_"="_SCR("AGG")
+54 SET ^TMP($JOB,"YSCOR",40)=$$GET1^DIQ(601.87,749_",",3,"I")_"="_SCR("ACT")
+55 ; MMPI-2-RF^Interpersonal
+56 SET ^TMP($JOB,"YSCOR",41)=$$GET1^DIQ(601.87,752_",",3,"I")_"="_SCR("FML")
+57 SET ^TMP($JOB,"YSCOR",42)=$$GET1^DIQ(601.87,753_",",3,"I")_"="_SCR("IPP")
+58 SET ^TMP($JOB,"YSCOR",43)=$$GET1^DIQ(601.87,754_",",3,"I")_"="_SCR("SAV")
+59 SET ^TMP($JOB,"YSCOR",44)=$$GET1^DIQ(601.87,755_",",3,"I")_"="_SCR("SHY")
+60 SET ^TMP($JOB,"YSCOR",45)=$$GET1^DIQ(601.87,756_",",3,"I")_"="_SCR("DSF")
+61 ; MMPI-2-RF^Interest
+62 SET ^TMP($JOB,"YSCOR",46)=$$GET1^DIQ(601.87,750_",",3,"I")_"="_SCR("AES")
+63 SET ^TMP($JOB,"YSCOR",47)=$$GET1^DIQ(601.87,751_",",3,"I")_"="_SCR("MEC")
+64 ; MMPI-2-RF^Personality Psychopathology
+65 SET ^TMP($JOB,"YSCOR",48)=$$GET1^DIQ(601.87,757_",",3,"I")_"="_SCR("AGGR")
+66 SET ^TMP($JOB,"YSCOR",49)=$$GET1^DIQ(601.87,758_",",3,"I")_"="_SCR("PSYC")
+67 SET ^TMP($JOB,"YSCOR",50)=$$GET1^DIQ(601.87,759_",",3,"I")_"="_SCR("DISC")
+68 SET ^TMP($JOB,"YSCOR",51)=$$GET1^DIQ(601.87,760_",",3,"I")_"="_SCR("NEGE")
+69 SET ^TMP($JOB,"YSCOR",52)=$$GET1^DIQ(601.87,761_",",3,"I")_"="_SCR("INTR")
+70 QUIT
+71 ;
DLLSTR(YSDATA,YS,YSTRNG) ;
+1 ; YSTRNG = 1 Score Instrument
+2 ; YSTRNG = 2 get Report Answers and Text
+3 NEW CANTSAY,CNT,DASHES,RSP,RSLT,SCALE,SCR,TSARR,TXT,YSINSNAM,YSAD
+4 SET RSLT=""
SET CNT=""
SET SCR=""
SET CANTSAY=""
+5 ;
+6 DO DATA1
+7 DO SCAN^YTSMPIR(.CNT,.RSP)
+8 ;
+9 IF YSTRNG=1
Begin DoDot:1
+10 DO BLDRAW^YTSMPIRD
+11 DO SCORE
+12 DO SCORESV
End DoDot:1
+13 ;
+14 IF YSTRNG=2
Begin DoDot:1
+15 KILL TSARR
+16 SET TXT=""
SET TSARR("NOADM")=""
+17 SET YSAD=YS("AD")
+18 ; special call to get RESULTS since there are TRANSFORMED values
+19 DO LDTSCOR^YTSCORE(.TSARR,YSAD)
+20 IF TSARR("NOADM")=""
Begin DoDot:2
+21 DO PROGNOTE^YTSMPI2P
End DoDot:2
+22 SET YSDATA($ORDER(YSDATA(""),-1)+1)=999999999999_U_U_$SELECT(TSARR("NOADM")'="":TSARR("NOADM"),1:TXT)
End DoDot:1
+23 KILL T,K2
+24 QUIT