Stream: questionnaire
Topic: STU3 validation error for code in contained value set
Morten Ernebjerg (Aug 05 2020 at 14:50):
Hi :wave: I am validating a STU3 QuestionnaireResponse against a Questionnaire with the newest validator (5.0.7-SNAPSHOT) and am getting a strange error for an answer coded with SNOMED CT. The code is in a ValueSet that is contained in the questionnaire (both resources are shown below) and is a valid code. Nonetheless, the validator says (full output pasted in further down):
Error @ QuestionnaireResponse.item[0].answer[0] (line 12, col52) : The value provided (http://snomed.info/sct::55011004) is not in the options value set in the questionnaire
If I replace the SNOMED code with a LOINC code in both resources, everything works fine. If I enter an invalid SNOMED code, the validator complains about it being invalid, so it is finding the code. Spent 30 minutes going over this and still did not spot the issue - is this a known problem or am I missing smt?
QuestionnaireResponse resource:
{
"resourceType": "QuestionnaireResponse",
"language": "en",
"questionnaire": {
"reference": "http://example.com/Questionnaire/testQ"
},
"status": "completed",
"item": [{
"linkId": "change",
"answer": [{
"valueCoding": {
"system": "http://snomed.info/sct",
"code": "55011004"
}
}]
}]
}
Questionnaire resource:
{
"resourceType": "Questionnaire",
"url": "http://example.com/Questionnaire/testQ",
"status": "draft",
"item": [{
"linkId": "change",
"type": "choice",
"options": {
"reference": "#includesVS"
}
}],
"contained": [{
"resourceType": "ValueSet",
"url": "http://example.com/ValueSet/testVS",
"id": "includesVS",
"status": "active",
"expansion": {
"identifier": "urn:uuid:1f503a0a-b45d-406e-9bfa-43e78a25fe97",
"timestamp": "2020-06-23T12:08:51.687Z",
"contains": [{
"system": "http://snomed.info/sct",
"code": "55011004"
}]
}
}]
}
Validator output:
USERX$ java -jar validator/org.hl7.fhir.validator.jar -version 3.0.2 -ig questionnaire/ examples/test.QuestionnaireResponse.json
FHIR Validation tool Version 5.0.7-SNAPSHOT (Git# 6bc790d98b04). Built 2020-06-07T08:35:37.25+10:00 (59 days old)
Detected Java version: 12.0.2 from /Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home on x86_64 (64bit). 4096MB available
Arguments: -version 3.0.2 -ig questionnaire/ examples/test.QuestionnaireResponse.json
Directories: Current = /Users/[REMOVED], Package Cache = /Users/[REMOVED]
.. FHIR Version 3.0, definitions from hl7.fhir.r3.core#3.0.2
.. connect to tx server @ http://tx.fhir.org
(v3.0.2)
+ .. load IG from questionnaire/
.. validate [examples/test.QuestionnaireResponse.json]
Terminology server: Check for supported code systems for http://snomed.info/sct
*FAILURE* validating examples/test.QuestionnaireResponse.json: error:1 warn:0 info:0
Error @ QuestionnaireResponse.item[0].answer[0] (line 12, col52) : The value provided (http://snomed.info/sct::55011004) is not in the options value set in the questionnaire
Lloyd McKenzie (Aug 05 2020 at 22:20):
@Grahame Grieve is the correct action here to post a Git issue against HAPI core?
Grahame Grieve (Aug 06 2020 at 01:37):
yes
Grahame Grieve (Aug 06 2020 at 01:45):
note, though, that this a problem in the questionnaire, not the validator
Morten Ernebjerg (Aug 06 2020 at 07:14):
note, though, that this a problem in the questionnaire, not the validator
@Grahame Grieve just so I report this correctly: do you mean that it is a problem with the general handling of Questionnaire resources?
Grahame Grieve (Aug 06 2020 at 07:39):
no it's a problem with your questionnaire
Grahame Grieve (Aug 06 2020 at 07:45):
I meant to describe it - the embedded value set is not correct:
Grahame Grieve (Aug 06 2020 at 07:45):
"contains": [{
"system": "http://snomed.info/sct",
"concept" : [{
"code": "55011004"
}]
}]
Morten Ernebjerg (Aug 06 2020 at 11:28):
Ah right, so I can get it to work if my value set only contains compose
. But the moment I add expansion
, I get the error, with or without the compose
element. Yet the contained value set validates OK as a standalone. I think my morning coffee is not working, I must admit I still do not see the error in the expansion/the use of expanded value sets (or understand why it works with LOINC but not SNOMED).
Grahame Grieve (Aug 06 2020 at 11:30):
hmm. what I pasted there is wrong..
Grahame Grieve (Aug 06 2020 at 12:31):
found the problem and fixed it. It will be in today's release
Morten Ernebjerg (Aug 06 2020 at 12:36):
Thanks, as always, @Grahame Grieve :tada:
Last updated: Apr 12 2022 at 19:14 UTC