Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: YTSBSS

YTSBSS.m

Go to the documentation of this file.
  1. YTSBSS ;SLC/PIJ - Score BSS ; 01/19/2016
  1. ;;5.01;MENTAL HEALTH;**123**;Dec 30, 1994;Build 73
  1. ;
  1. Q
  1. ;
  1. DATA1 ;
  1. S SCORE=0
  1. S YSINSNAM=$P($G(YSDATA(2)),U,3)
  1. I $G(YSINSNAM)="" S YSINSNAM=$G(YS("CODE"),"NO NAME PASSED")
  1. S NODE=2 F S NODE=$O(YSDATA(NODE)) Q:NODE="" D ; Start at YSDATA(3)
  1. .S DATA=YSDATA(NODE)
  1. .S YSQN=$P($G(DATA),U,1)
  1. .S YSSEQ=$P($G(DATA),U,2),DES=YSSEQ
  1. .S YSCDA=$P($G(DATA),U,3)
  1. .S YSAN=$$GET1^DIQ(601.75,YSCDA_",",3,"I")
  1. .S LEG=$$GET1^DIQ(601.75,YSCDA,4,"I")
  1. .I (NODE'=22),(NODE'=23) D
  1. ..S SCORE=SCORE+LEG
  1. .;S STRING=STRING_"| "_DES_". "_YSAN_" ("_LEG_" points)"
  1. .S STRING=STRING_"| "_DES_". "_YSAN_" ("_LEG
  1. .S:LEG'=1 STRING=STRING_" points)"
  1. .S:LEG=1 STRING=STRING_" point)"
  1. Q
  1. ;
  1. STRING ;
  1. I '$D(^TMP($J,"YSCOR")) D Q
  1. .S STRING1=STRING1_"| "_YSINSNAM_" score could not be determined."
  1. .S STRING1=STRING1_"|| Questions and answers"
  1. ;
  1. S SCORE=$P($G(^TMP($J,"YSCOR",2)),"=",2)
  1. S STRING1=STRING1_" "_YSINSNAM_" Score: "_SCORE
  1. S STRING1=STRING1_"||The BSS is intended to assess thoughts, plans and intent to die by suicide "
  1. S STRING1=STRING1_"or attempt suicide over the past week. Total scores can range from 0-38."
  1. S STRING1=STRING1_" There is no specific cut-off score to classify severity or guide patient management, "
  1. S STRING1=STRING1_"however, increasing scores reflect greater risk, and any positive response to any"
  1. S STRING1=STRING1_" item may reflect the presence of suicidal intention and should be investigated further. "
  1. S STRING1=STRING1_"||Questions and answers|"
  1. Q
  1. ;
  1. SCORESV ;
  1. I $D(^TMP($J,"YSG",1)),^TMP($J,"YSG",1)="[ERROR]" D Q ;-->out
  1. .K ^TMP($J,"YSCOR")
  1. .S ^TMP($J,"YSCOR",1)="[ERROR]"
  1. .S ^TMP($J,"YSCOR",2)=YSINSNAM_" Scale not found"
  1. ;
  1. K ^TMP($J,"YSCOR")
  1. S ^TMP($J,"YSCOR",1)="[DATA]"
  1. ;Removed this scale.
  1. ;S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,337_",",3,"I")_"="_SCORE ; Suicidal Ideation
  1. S ^TMP($J,"YSCOR",2)=$$GET1^DIQ(601.87,900_",",3,"I")_"="_SCORE ; Score
  1. Q
  1. ;
  1. DLLSTR(YSDATA,YS,YSTRNG) ;
  1. ; YSTRNG = 1 Score Instrument
  1. ; YSTRNG = 2 get Report Answers and Text
  1. N DATA,DES,LEG,NODE,YSAN,YSQN,YSCDA,SCORE
  1. N YSSEQ,YSINSNAM,STRING,STRING1
  1. ;
  1. S (STRING,STRING1)=""
  1. S SCORE=0
  1. ;
  1. D DATA1
  1. I YSTRNG=1 D SCORESV
  1. I YSTRNG=2 D
  1. .D LDSCORES^YTSCORE(.YSDATA,.YS)
  1. .D STRING
  1. .S STRING1=STRING1_STRING
  1. .S YSDATA($O(YSDATA(""),-1)+1)=999999999999_U_U_STRING1
  1. Q