Stream: IG creation
Topic: Does the validator have access to all of the variables?
Diane (Mar 13 2022 at 15:11):
I am getting errors in some of my example questionnaire responses
A. error Item has answer, even though it is not enabled (item id = 'linkId_3')
When I look at all of the link Ids mentioned, the example questionnaire response shows a response to the proceeding question or questions (eg. linkId_1 and linkId_2) that are necessary for the question to be enabled. And, the response is consistent with the answer needed for enablement. In fact, it was enabled, because we created the example questionnaire responses by hand, so we wouldn't have seen the questions if they weren't enabled.
I wonder if the problem might be that the validator is not processing the variable in the enableWhen expressions correctly, such as %eventOccurredAtLeadPISite = 'N'.
Does the validator have access to all of the variables?
B. QuestionnaireResponse.item[1].item[0].item[1].answer[0] information Cannot validate options because no option or options are provided
This is information, not a error or warning, so I guess that I can suppress this.
It seems to be happening where the options are dynamically generated using an answerExpression.
Does the validator have access to the variables to run the answerExpression like:
iif(%eventOccurredAtLeadPISite = 'Y', %lookupInitiateStudy.descendants().where(linkId = 'in7.1.1').answer.value, %lookupInitiateStudy.descendants().where(item.where(linkId = 'in8.9' and answer.value = %relyingSiteForForm)).item.descendants().where(linkId = 'in8.1.1').answer.value)
Lloyd McKenzie (Mar 13 2022 at 16:41):
Is the variable declared in the questionnaire? You can't pass in variables from outside.
You don't suppress things because you can. You suppress because you understand the issue and have determined it's not a problem.
Diane (Mar 13 2022 at 19:55):
Some of the variables like %eventOccurredAtLeadPISite are declared and initialized with values in the questionnaires as the user answers the questions. It would seem like the validator should have access to those, but can it simulate the variable
becoming initialized with a value as the question is answered? The expressions are based the variable getting the value from the %questionnaire as the question is answered. Does the validator know since this is not real-time, it has to look in the
questionnaire response instead?
The other variables are all based off the JSON text that is passed in through the launch context variable that LHC Forms receives as a parameter when our software calls LHC Forms. This was the solution for passing the parent QR into the child questionnaires decided at the SDC call https://confluence.hl7.org/display/FHIRI/FHIR+SDC+Minutes+CC+20220210.
I do not and would not suppress messages without your input. I am still trying to understand how the validator handles variables so that I can be sure this is even where the issue is occurring. But, I think that if there is an error that is the most important issue to focus on.
Lloyd McKenzie (Mar 13 2022 at 22:27):
It has to look in the QuestionnaireResponse. And it's entirely likely that the validator does not yet support all of the extensions defined in SDC.
Diane (Mar 14 2022 at 04:45):
After looking through our example Questionnaire Responses, it looks like all 8 of our example Questionnaire Responses have either
A. Error message: Item has answer, even though it is not enabled
or
B. Information message: QuestionnaireResponse.item[1].item[0].item[1].answer[0] information Cannot validate options because no option or options are provided because they have answerExpressions for the choice items.
How do you want us to resolve A?
How do you want us to resolve B?
If we delete the answers out of the JSON files for the questions that the IG doesn't think are enabled, that would remove the errors. But, it makes the examples less helpful.
Lloyd McKenzie (Mar 14 2022 at 14:14):
If the issue is problems with the validator, then we won't stop the IG from going to ballot. We'll definitely need to update the validator before the IG can proceed to publication.
Grahame Grieve (Mar 14 2022 at 20:13):
have you got examples?
Lloyd McKenzie (Mar 15 2022 at 01:49):
In off-line discussion, it seems that the issue is that the enableWhen depends on context variables passed from outside, including a custom launchContext. So that's not something the validator ever could support. I've suggested modifying the Questionnaire to drive solely off answers within the QR - even if some of them are hidden answers that are populated based on launch context.
Grahame Grieve (Mar 15 2022 at 02:17):
the validator might be able to support that, but not in an IG.
Grahame Grieve (Mar 15 2022 at 02:17):
no it could, actually
Grahame Grieve (Mar 15 2022 at 02:18):
a parameters resource that feeds to it. Like the expansion parameters one.
Grahame Grieve (Mar 15 2022 at 02:18):
but it sure doesn't do that now
Lloyd McKenzie (Mar 15 2022 at 03:47):
In general, you wouldn't want the Questionnaire to behave that way because the launch context when viewing the form isn't necessarily going to be the same as when you fill out the form.
Grahame Grieve (Mar 15 2022 at 03:58):
I thought we were talking about validation?
Lloyd McKenzie (Mar 15 2022 at 14:46):
We are. You don't want the validation results to vary depending on the context of how you open the response.
Grahame Grieve (Mar 15 2022 at 19:56):
why not?
Lloyd McKenzie (Mar 15 2022 at 19:57):
Because then you have a QR that's valid on completion (and thus allowing the QR to be marked complete in the first place). However, if opened a day or two later with a slightly different context, the QR would suddenly be invalid.
Lloyd McKenzie (Mar 15 2022 at 19:58):
Population based on context makes total sense. Validation based on context is inevitably going to cause grief.
Grahame Grieve (Mar 15 2022 at 20:05):
but you'd choose to validate based on context, so that's what you'd want to happen.
Lloyd McKenzie (Mar 15 2022 at 20:46):
The QR could be validated in a wide range of contexts.
Grahame Grieve (Mar 15 2022 at 20:46):
y so? You'd feed the context. I'm not sure i follow the issue
Lloyd McKenzie (Mar 15 2022 at 20:47):
There would typically be a patient context when launching, but not necessarily when subsequently reviewing or transmitting. And validation could happen at any point.
Lloyd McKenzie (Mar 15 2022 at 20:47):
The context is "who is the current user?" "what is the currently active patient?"
Lloyd McKenzie (Mar 15 2022 at 20:47):
If those change between filling out the form and subsequently looking at it, the validation results shouldn't change.
Last updated: Apr 12 2022 at 19:14 UTC