YTQAPI2D ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING #2 ; 9/27/18 10:27am
;;5.01;MENTAL HEALTH;**147,150**;Dec 30, 1994;Build 210
;
; This routine was split from YTQAPI2A.
; This routine handles limited complex reporting requirements without
; modifying YS_AUX.DLL by adding free text "answers" that can be used by
; a report.
;,
; Assumptions: EDIT incomplete instrument should ignore the extra answers
; since there are no associated questions. GRAPHING should ignore the
; answers since they not numeric.
;
SPECIAL(TSTNM,YSDATA,N,YSAD,YSTSTN,QUIT) ; add "hidden" computed question text
;
N ANSWER,DEPSCORE,IEN,KEY,LP,PCT,PTSD,SATTSCORE,SCORES,SCRE,SUCSCORE,SUISCORE,SWHENSCORES,TEXT,TEXT1,TEXT2
N TEXT2A,TEXT2B,TOT,YSCORE,YSCREC,SUISCRN,ALLQUES,POSTXT1,POSTXT2,QUE1621,QUE67,QUE915
;
I TSTNM="AD8" D Q
.N TOTAL,TXT
.S N=N+1
.D GETSCORE^YTQAPI8(.YSCORE,.YS)
.I ^TMP($J,"YSCOR",1)'="[DATA]" Q
.S TOTAL=$P(^TMP($J,"YSCOR",2),"=",2)
.I TOTAL>1 S TXT="COGNITIVE IMPAIRMENT IS LIKELY TO BE PRESENT."
.I TOTAL<2 S TXT="NORMAL COGNITION"
.S YSDATA(N)="7771^9999;1^"_TXT S N=N+1
;
I TSTNM="EPDS" D Q
.N TOTAL,TXT,EPDS
.S N=N+1
.D GETSCORE^YTQAPI8(.YSCORE,.YS)
.I ^TMP($J,"YSCOR",1)'="[DATA]" Q
.D YSARRAY^YTQAPI2C(.EPDS)
.I $G(EPDS(10)) D
..S TXT="Question 10 that assesses ""thought of harming"" oneself was answered in the "
..S TXT2="POSITIVE direction, additional clinical assessment is indicated."
..S YSDATA(N)="7771^9999;1^"_TXT S N=N+1
..S YSDATA(N)="7772^9999;1^"_TXT2 S N=N+1
;
I TSTNM="FTND" D
.Q
.N TOTAL,TXT,FTND,TEXT1,TEXT2,TEXT3,TXT2
.S N=N+1
.D GETSCORE^YTQAPI8(.YSCORE,.YS)
.I ^TMP($J,"YSCOR",1)'="[DATA]" Q
.;D YSARRAY^YTQAPI2C(.FTND)
.S TOTAL=$P(^TMP($J,"YSCOR",2),"=",2)
.S TEXT1=" indicating "
.;S TEXT2="nicotine dependence."
.I TOTAL<3 S TEXT3="VERY LOW nicotine dependence."
.I TOTAL>2,TOTAL<5 S TEXT3="LOW nicotine dependence."
.I TOTAL=5 S TEXT3="MEDIUM nicotine dependence."
.I TOTAL>5,TOTAL<8 S TEXT3="HIGH nicotine dependence."
.I TOTAL>7 S TEXT3="VERY HIGH nicotine dependence."
.S YSDATA(N)="7771^9999;1^"_TOTAL_TEXT1_TEXT3
.;
;
;
;I $L($T(SPECIAL^YTQAPI2E)) D SPECIAL^YTQAPI2E(TSTNM,.YSDATA,N,.YSAD,.YSTSTN)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTQAPI2D 2256 printed Oct 16, 2024@18:19 Page 2
YTQAPI2D ;SLC/BLD- MHAX ANSWERS SPECIAL HANDLING #2 ; 9/27/18 10:27am
+1 ;;5.01;MENTAL HEALTH;**147,150**;Dec 30, 1994;Build 210
+2 ;
+3 ; This routine was split from YTQAPI2A.
+4 ; This routine handles limited complex reporting requirements without
+5 ; modifying YS_AUX.DLL by adding free text "answers" that can be used by
+6 ; a report.
+7 ;,
+8 ; Assumptions: EDIT incomplete instrument should ignore the extra answers
+9 ; since there are no associated questions. GRAPHING should ignore the
+10 ; answers since they not numeric.
+11 ;
SPECIAL(TSTNM,YSDATA,N,YSAD,YSTSTN,QUIT) ; add "hidden" computed question text
+1 ;
+2 NEW ANSWER,DEPSCORE,IEN,KEY,LP,PCT,PTSD,SATTSCORE,SCORES,SCRE,SUCSCORE,SUISCORE,SWHENSCORES,TEXT,TEXT1,TEXT2
+3 NEW TEXT2A,TEXT2B,TOT,YSCORE,YSCREC,SUISCRN,ALLQUES,POSTXT1,POSTXT2,QUE1621,QUE67,QUE915
+4 ;
+5 IF TSTNM="AD8"
Begin DoDot:1
+6 NEW TOTAL,TXT
+7 SET N=N+1
+8 DO GETSCORE^YTQAPI8(.YSCORE,.YS)
+9 IF ^TMP($JOB,"YSCOR",1)'="[DATA]"
QUIT
+10 SET TOTAL=$PIECE(^TMP($JOB,"YSCOR",2),"=",2)
+11 IF TOTAL>1
SET TXT="COGNITIVE IMPAIRMENT IS LIKELY TO BE PRESENT."
+12 IF TOTAL<2
SET TXT="NORMAL COGNITION"
+13 SET YSDATA(N)="7771^9999;1^"_TXT
SET N=N+1
End DoDot:1
QUIT
+14 ;
+15 IF TSTNM="EPDS"
Begin DoDot:1
+16 NEW TOTAL,TXT,EPDS
+17 SET N=N+1
+18 DO GETSCORE^YTQAPI8(.YSCORE,.YS)
+19 IF ^TMP($JOB,"YSCOR",1)'="[DATA]"
QUIT
+20 DO YSARRAY^YTQAPI2C(.EPDS)
+21 IF $GET(EPDS(10))
Begin DoDot:2
+22 SET TXT="Question 10 that assesses ""thought of harming"" oneself was answered in the "
+23 SET TXT2="POSITIVE direction, additional clinical assessment is indicated."
+24 SET YSDATA(N)="7771^9999;1^"_TXT
SET N=N+1
+25 SET YSDATA(N)="7772^9999;1^"_TXT2
SET N=N+1
End DoDot:2
End DoDot:1
QUIT
+26 ;
+27 IF TSTNM="FTND"
Begin DoDot:1
+28 QUIT
+29 NEW TOTAL,TXT,FTND,TEXT1,TEXT2,TEXT3,TXT2
+30 SET N=N+1
+31 DO GETSCORE^YTQAPI8(.YSCORE,.YS)
+32 IF ^TMP($JOB,"YSCOR",1)'="[DATA]"
QUIT
+33 ;D YSARRAY^YTQAPI2C(.FTND)
+34 SET TOTAL=$PIECE(^TMP($JOB,"YSCOR",2),"=",2)
+35 SET TEXT1=" indicating "
+36 ;S TEXT2="nicotine dependence."
+37 IF TOTAL<3
SET TEXT3="VERY LOW nicotine dependence."
+38 IF TOTAL>2
IF TOTAL<5
SET TEXT3="LOW nicotine dependence."
+39 IF TOTAL=5
SET TEXT3="MEDIUM nicotine dependence."
+40 IF TOTAL>5
IF TOTAL<8
SET TEXT3="HIGH nicotine dependence."
+41 IF TOTAL>7
SET TEXT3="VERY HIGH nicotine dependence."
+42 SET YSDATA(N)="7771^9999;1^"_TOTAL_TEXT1_TEXT3
+43 ;
End DoDot:1
+44 ;
+45 ;
+46 ;I $L($T(SPECIAL^YTQAPI2E)) D SPECIAL^YTQAPI2E(TSTNM,.YSDATA,N,.YSAD,.YSTSTN)
+47 QUIT