My first attempt at a snippet for use in my clinical work:
### Fagerstrom Test
- How soon after you wake up do you smoke your first cigarette? {formmenu: default=Within 5 minutes; 6-30 minutes; 31-60 minutes; After 60 minutes; name=q1}
- Do you find it difficult to refrain from smoking in places where it is forbidden (e.g., in church, at the library, in the cinema)? {formmenu: No; default=Yes; name=q2}
- Which cigarette would you hate most to give up? {formmenu: default=The first one in the morning; Any other; name=q3}
- How many cigarettes per day do you smoke? {formmenu: default=10 or fewer; 11-20; 21-30; 31 or more; name=q4}
- Do you smoke more frequently during the first hours after waking up than during the rest of the day? {formmenu: No; default=Yes; name=q5}
- Do you smoke when you are so ill that you are in bed most of the day? {formmenu: No; default=Yes; name=q6}
Total score = {=score}
{if: score<1}Scores of 0 indicate no nicotine dependence{elseif: score<3}Scores of 1-2 indicate low levels of nicotine dependence.{elseif: score<5}Scores from 3-4 suggest low to moderate levels of nicotine dependence.{elseif: score<8}Scores from 5-7 indicate moderate to high levels of nicotine dependence.{elseif: score<11}Scores from 8-10 indicate high levels of nicotine dependence.{endif}
{answerlist=[q1, q2, q3, q4, q5, q6]}
{low1=count(filter(answerlist, x -> x="Yes"))*1}
{low2=count(filter(answerlist, x ->x="6-30 minutes"))*1}
{low3=count(filter(answerlist, x ->x="The first one in the morning"))*1}
{Low4=count(filter(answerlist, x ->x="11-20"))*1}
{medium1=count(filter(answerlist, x -> x="31-60 minutes"))*2}
{medium2=count(filter(answerlist, x ->x="21-30"))*2}
{high1=count(filter(answerlist, x -> x="After 60 minutes"))*3}
{high2=count(filter(answerlist, x ->x="31 or more"))*3}{score=low1+low2+low3+low4+medium1+medium2+high1+high2}