Conversation
|
How it looks like - Screen.Recording.2022-09-30.at.16.31.26.mov |
| * answerBoolean = true | ||
|
|
||
| // this question will only be shown if of another question (comorbidities) has been answered in a certain way | ||
| RuleSet: enableWhenComorbidityyy(code) |
There was a problem hiding this comment.
Two questions:
- Are the three
ys at the end ofenableWhenComorbidityyyintentional or a typo? - Might it make sense to generalize this even more, so it is
RuleSet: enableWhenCode(question, code)?
There was a problem hiding this comment.
The y's were a typo!
I've generalised it, have a look. I don't feel enableWhenCode(comorbidities, SCT#35489007) has the same good flow to it though.
There was a problem hiding this comment.
I was just thinking it's more generalizable for people who copy/paste the example. The RuleSet w/ comorbities hard-coded only works as-is for people with that exact question in their questionnaire. If you really want the comorbidities RuleSet, you could take it a bit further and also add:
RuleSet: enableWhenComorbidity(code)
* insert enableWhenCode(comorbidities, {code})
cmoesel
left a comment
There was a problem hiding this comment.
@vadi2 -- Thanks again for the contribution! I think there are a few inconsistencies here that need to be addressed. I apologize -- they probably snuck in when you were implementing my suggestions!
Thanks again for your help on this!
| @@ -0,0 +1,59 @@ | |||
| // this question will only be shown when another question has been answered as 'true' | |||
There was a problem hiding this comment.
This description doesn't match the name of the RuleSet (enableWhenCode). I think it might be left over from your previous RuleSet.
| * enableWhen | ||
| * question = "{question}" | ||
| * operator = #= | ||
| * answerBoolean = {code} |
| * type = #integer | ||
| * text = "So how old are you?" | ||
| * required = true | ||
| * insert enableWhenCode(age-known, true) |
There was a problem hiding this comment.
true is a boolean, not a code. You probably need to reintroduce the enableWhenTrue RuleSet to handle booleans.
|
@vadi2 - I just noticed this PR is still open. I had made a few minor comments on your PR that haven't been resolved yet. Are you still interested in moving this PR forward? Or would you prefer that we make those last few updates for you? |
I heard of a call for more rulesets at the WGM - contributing one I found handy for dynamic behaviour in Questionnaires.