Anna,
I have emailed you the modified version of your form to accommodate the risk level calculation for the Columbia Suicide Severity Rating scale. In addition to correcting the calculation logic, I made the following enhancements.
- Questions 3 thru 5 are disabled until the user selects "Yes" for question 2 (per the guidelines, those questions are N/A unless the answer to question 2 is "Yes")
- I included a data display at the bottom of the form to dynamically display the Disposition Considerations; this is based on the calculated risk level
- I removed any superfluous coding on your form (in the function view)
- A pop-up box will display informing the user that not enough data has been entered to calculate the risk level if the user attempts to calculate the risk level before answering the appropriate questions
I tested several different scenarios and everything appears to be working in accordance with the rules provided, but you may want to test it yourself to be sure. I noticed the timeframes on the original form you provided for question 6 did not match the timeframes specified in the documentation so I modified those accordingly. If you need to make changes to those, just remember you will need to update the section of code that corresponds to the risk level calculation for question 6. I thoroughly documented the code so you should be able to easily identify what each section is doing.
The function that calculates the correct risk level is provided below for anyone else that might be interested. I've attached a text file version as well since code posted on the forum often loses legibility. Click here to access --> CSSR-Calculation-Function
//Calculate Suicide Risk Level - function fires when <Calculate CSSR> button is pressed
{fn CalcCSSR()
{
//Define local variables for function
local cssr_risk1 = 0 //used to store risk for questions 1 thru 5
local cssr_risk2 = 0 //used to store risk for question 6
local cssr_risk = 0 //used to store overall risk rating
local topquest = 0 //used to store highest question number receiving response of Yes
//Determine highest numbered question 1 through 5 receiving a response of Yes
//store question responses in array
local qresponse = array(DOCUMENT.CSSRS_11,DOCUMENT.CSSRS_21,DOCUMENT.CSSRS_3,DOCUMENT.CSSRS_4,DOCUMENT.CSSRS_5)
for i=1, i <= 5, i=i+1 //Loop through 5 questions
do
if (qresponse[i] == "Yes") then
topquest = i
else
//Do nothing, continue looping through questions
endif
endfor
//Determine risk level associated with questions 1 thru 5
cond
case topquest == 1 //Low risk
cssr_risk1 = 1
case topquest == 2 //Low risk
cssr_risk1 = 1
case topquest == 3 //Moderate risk
cssr_risk1 = 2
case topquest == 4 //High risk
cssr_risk1 = 3
case topquest == 5 //High risk
cssr_risk1 = 3
else
cssr_risk1 = 0 //No risk
endcond
//Determine risk level associated with question 6
cond
case DOCUMENT.CSSRS_6A == "Greater than 3 months"//Low risk
cssr_risk2 = 1
case DOCUMENT.CSSRS_6A == "Between 1 week and 3 months"//Moderate risk
cssr_risk2 = 2
case DOCUMENT.CSSRS_6A == "Less than 1 week"//High risk
cssr_risk2 = 3
else
cssr_risk2 = 0 //No risk
endcond
//Determine collective risk level (higher risk of risk1 and risk2)
if (cssr_risk1 == cssr_risk2) then
cssr_risk = cssr_risk1
else
if (cssr_risk1 > cssr_risk2) then
cssr_risk = cssr_risk1
else
cssr_risk = cssr_risk2
endif
endif
//Assign proper description to OBS term and update disposition considerations on form
cond
case cssr_risk == 1 //Low risk
OBSNOW("CSSRSRESULT","LOW")
gvar_DispCons = "Outpatient mental health referral, community resource information (e.g. 774-HELP)"
case cssr_risk == 2 //Moderate risk
OBSNOW("CSSRSRESULT","MODERATE")
gvar_DispCons = "PHP referral, CSU referral, Crisis Services follow-up, follow up with outpatient providers, routine mental health referral"
case cssr_risk == 3 //High risk
OBSNOW("CSSRSRESULT","HIGH")
gvar_DispCons = "Psychiatric hospitalization, CSU referral, PHP referral, Crisis Services follow-up, follow up with outpatient providers"
else
userok("Sorry. Not enough data to determine suicide risk level.")
endcond
}
}
Posted : April 3, 2016 10:59 am