Stream: netherlands
Topic: Validation of MedMij example
Henk-Jan Meijer (Nov 25 2019 at 20:01):
I'm having trouble to validate this MedMij example resource against the published versions of MedMij profiles using the official FHIR validator. I've tried profiles from both Simplifier and Github, but that did not make a difference.
Setup:
curl https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.validator.jar > validator.jar curl 'https://simplifier.net/nictizstu3-zib2017/observation-example-duplicate-10/$download?format=json' > example.json mkdir profiles cd profiles curl 'https://simplifier.net/nictizstu3-zib2017/zib-laboratorytestresult-observation/$download?format=json' > zib-medmij-profile.json curl 'https://simplifier.net/nictizstu3-zib2017/nl-core-observation/$download?format=json' > nl-core-observation-profile.json curl 'https://simplifier.net/nictizstu3-zib2017/zibextensioncodespecification/$download?format=json' > zib-code-specification-extension.json curl 'http://decor.nictiz.nl/fhir/3.0/public/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.13.1.1--20171231000000' > resultaat-type-codelijst.xml curl 'http://decor.nictiz.nl/fhir/3.0/public/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.13.1.5--20171231000000' > onderzoek-codelijst.xml curl 'http://decor.nictiz.nl/fhir/3.0/public/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.13.1.7--20171231000000' > interpretatie-vlaggen-codelijst.xml cd ..
Command:
java -jar validator.jar example.json -version 3.0.1 -ig profiles
Output:
FHIR Validation tool Version 4.1.7-SNAPSHOT - Built 2019-11-21T18:18:33.170+11:00 - Git 45df4708d77b Detected Java version: 1.8.0_131 from /usr/lib/jvm/java-8-oracle/jre on amd64 (64bit). 1682MB available Arguments: example.json -version 3.0.1 -ig profiles Directories: Current = /tmp, Package Cache = /home/hjpv/.fhir/packages .. 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 profiles .. validate [example.json] Terminology server: Check for supported code systems for http://snomed.info/sct *FAILURE* validating example.json: error:3 warn:0 info:2 Error @ Observation.category[0].coding[0] (line 13, col10) : unable to find code 49581000146104 in http://snomed.info/sct for 'http://snomed.info/sct#49581000146104' Error @ Observation.category[0] (line 11, col6) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Error @ Observation.category[1] (line 20, col6) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Information @ Observation.category[0] (line 11, col6) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#49581000146104) Information @ Observation.category[1] (line 20, col6) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#275711006)
It seems to find three problems:
- Unknown snomed code
- Incorrect slicing definition for
Observation.category
- Not using recommended value set for
Observation.category
Especially the second one is difficult to circumvent for me. Am I doing something wrong? Any help appreciated, thanks!
Grahame Grieve (Nov 25 2019 at 20:15):
this is on my todo list
Henk-Jan Meijer (Nov 26 2019 at 04:32):
@Grahame Grieve so this is an issue with the validator then? Any way I can track progress? Thanks for your quick reply!
Grahame Grieve (Nov 26 2019 at 04:34):
It's at least partially an issue with the validator. Maybe with the profiles too. I'll ask Alexander to keep you informed
Henk-Jan Meijer (Nov 26 2019 at 04:38):
Great, thanks again
Alexander Henket (Nov 26 2019 at 19:12):
@Henk-Jan Meijer We are aware of some issues with the profiles around slicing. In finding out how to best deal with that, we tested them against the Java validator and the .Net validator. It turned out that the profiles could be improved, but also that both the java validator and the .Net validator needed some tweaks. The updated profiles have been committed to our develop branch in github. Firely is working on updating the .Net validator (@Ardon Toonstra could comment on that), and @Grahame Grieve is looking into the java validator.
It is possible that in updating the reference frameworks, issues are discovered that we don't know about today, but would require other updates to the profiles. This is why we hold off publication for the moment.
Ardon Toonstra (Nov 27 2019 at 08:45):
I will provide some test cases for the java and .Net validator shortly! :)
Grahame Grieve (Nov 27 2019 at 12:24):
thx
Grahame Grieve (Nov 29 2019 at 18:19):
is 49581000146104 a valid snomed code is it?
Grahame Grieve (Nov 29 2019 at 18:20):
looks like it should be 118246004
Grahame Grieve (Nov 29 2019 at 18:21):
(this is from the test cases) @Ardon Toonstra which come from NIctiz specs @Alexander Henket
Grahame Grieve (Nov 29 2019 at 18:30):
after updating for other unrelated errors, and fixing the manifest, those tests pass without any modifications to the validator. Can you check the changes please
Alexander Henket (Nov 30 2019 at 08:26):
Hi Grahame: yes that is valid http://terminologie.nictiz.nl/art-decor/snomed-ct?conceptId=49581000146104
pasted image
Grahame Grieve (Nov 30 2019 at 09:23):
That’s bizarre - why use a different concept id for the same concept as in the international version?
Alexander Henket (Nov 30 2019 at 11:44):
118246004 is a navigational concept, 49581000146104 is a finding. So not entirely the same as they are from different branches and thus have different semantics?
Alexander Henket (Nov 30 2019 at 17:34):
But I cannot tell you why this concept did not exist internationally. Seems generic enough.
Grahame Grieve (Nov 30 2019 at 18:16):
interesting. I wonder what 'Laboratory test finding (Finding)' as a finding is. It sounds like a navigational concept to me. However, what is going in is clearly intentional not a mistake. I'll have to get dutch snomed loaded on tx.fhir.org
Grahame Grieve (Nov 30 2019 at 18:23):
entering MLDS through the NL portal has competely confused MLDS abut which language to use for me...
Alexander Henket (Nov 30 2019 at 20:54):
Let me know if you need help somewhere with that
Ardon Toonstra (Dec 06 2019 at 13:00):
@Grahame Grieve
after updating for other unrelated errors, and fixing the manifest, those tests pass without any modifications to the validator. Can you check the changes please
Thnx, looks ok! I now see that I already made a note that the Java validator supported this. The .NET validator does not, so I will reuse the test files. At least these tests may help in regression testing...
Grahame Grieve (Dec 06 2019 at 18:11):
indeed. Feel free to add any other validation test cases
Ted Vinke (Jan 21 2020 at 14:19):
Just wondering: still got some errors by repeating Henk-Jan's test case (by downloading everything with curl some minutes ago) and getting the following:
tvinke@localhost ~/projects/fhir-validation-test $ java -jar validator.jar example.json -version 3.0.1 -ig profiles FHIR Validation tool Version 4.1.51-SNAPSHOT (Git# 32240f41c724). Built 2020-01-21T12:27:30.908+11:00 (12 hours old) Detected Java version: 1.8.0_121 from /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre on x86_64 (64bit). 3641MB available Arguments: example.json -version 3.0.1 -ig profiles Directories: Current = /Users/tvinke/projects/fhir-validation-test, Package Cache = /Users/tvinke/.fhir/packages .. 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 profiles .. validate [example.json] Terminology server: Check for supported code systems for http://snomed.info/sct *FAILURE* validating example.json: error:3 warn:2 info:2 Error @ Observation.category[0].coding[0] (line 13, col10) : unable to find code 49581000146104 in http://snomed.info/sct (version http://snomed.info/sct/900000000000207008/version/20190731) for 'http://snomed.info/sct#49581000146104' Error @ Observation.category[0] (line 11, col6) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Error @ Observation.category[1] (line 20, col6) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Information @ Observation.category[0] (line 11, col6) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#49581000146104) Information @ Observation.category[1] (line 20, col6) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#275711006) Warning @ Observation.category[1].coding[0] (line 22, col10) : The display "Chemistry" is not a valid display for the code {http://snomed.info/sct}275711006 - should be one of ["Serum chemistry test","Serum chemistry test (procedure)"] Warning @ Observation.interpretation (line 51, col16) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-interpretation (http://hl7.org/fhir/ValueSet/observation-interpretation, and a code should come from this value set unless it has no suitable code) (codes = http://snomed.info/sct#281302008)
I'm about to rely a lot on the validator in my current project, so I'd like to know if there are still some known issues with it, or may be that I'm using it incorrectly.
Alexander Henket (Jan 27 2020 at 09:25):
Hi @Ted Vinke I must admit I missed your call for help here. The java validator is mostly maintained by @Grahame Grieve. However it is maintained on GitHub and pull requests are accepted.
Nictiz has been working with Firely for the .Net validator and Grahame for the Java validator. It's a process but we'll get there.
Looking at the error you get I can see that the Dutch SNOMED CT extension is not loaded onto tx.fhir.org that you use by default as terminology server. The command you use to fire up the validator is based on the FHIR Core spec. This explains why the extensions are flagged as unknown. The command should include -ig and the path to the MedMij profiles e.g.:
-ig profiles
Just give it the set and the validator will pick the right profile based on the Patient.meta.profile in the instance. As it stands today the Java validator is not capable of producing snapshots. Also Simplifier is not capable of producing snapshots so the Simplifier package you installed does not have them and the Java validator cannot produce them. For that reason we distribute a separate folder containing the snapshots produced using the .net framework offline. You can find that on Github.
Using that snapshot folder you can validate using:
$ java -jar org.hl7.fhir.validator.jar -ig "/Users/ahenket/Downloads/nictiz-stu3-zib2017-snapshots-1.3.3" -version 3.0 -recurse -debug STU3-Java/instances/medmij-bgz-fhir3-0-1-labresult-ts-01.xml FHIR Validation tool Version 4.1.53-SNAPSHOT (Git# ee6e0d90de9b). Built 2020-01-24T17:20:43.54+11:00 (3 days old) Detected Java version: 1.8.0_121 from /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre on x86_64 (64bit). 3641MB available Arguments: -ig /Users/ahenket/Downloads/nictiz-stu3-zib2017-snapshots-1.3.3 -version 3.0 -recurse -debug STU3-Java/instances/medmij-bgz-fhir3-0-1-labresult-ts-01.xml Directories: Current = /Users/ahenket/Development/FHIR, Package Cache = /Users/ahenket/.fhir/packages .. 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 /Users/ahenket/Downloads/nictiz-stu3-zib2017-snapshots-1.3.3 * load file: zib-OxygenSaturation.xml .. success . . . .. validate [STU3-Java/instances/medmij-bgz-fhir3-0-1-labresult-ts-01.xml] Terminology server: Check for supported code systems for http://snomed.info/sct *FAILURE* validating STU3-Java/instances/medmij-bgz-fhir3-0-1-labresult-ts-01.xml: error:3 warn:1 info:2 Error @ Observation.category[0].coding[0] (line 8, col17) : unable to find code 49581000146104 in http://snomed.info/sct (version http://snomed.info/sct/900000000000207008/version/20190731) for 'http://snomed.info/sct#49581000146104' Error @ Observation.category[0] (line 7, col15) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Error @ Observation.category[1] (line 14, col15) : Could not match any discriminators ([coding.system, coding.code]) for slice Observation.category:ResultType in profile http://nictiz.nl/fhir/StructureDefinition/zib-LaboratoryTestResult-Observation - None of the discriminator [coding.system, coding.code] have fixed value, binding or existence assertions Information @ Observation.category[0] (line 7, col15) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#49581000146104) Information @ Observation.category[1] (line 14, col15) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set) (codes = http://snomed.info/sct#275711006) Warning @ Observation.interpretation (line 39, col21) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-interpretation (http://hl7.org/fhir/ValueSet/observation-interpretation, and a code should come from this value set unless it has no suitable code) (codes = http://snomed.info/sct#281302008)
Disecting the errors:
- Error @ Observation.category[0].coding[0] (line 8, col17) : unable to find code 49581000146104 -- due to Dutch extension not being present in the terminology server tx.fhir.org. Should be fixed over time by @Rob Hausam. At the very least it should not be an error, but a warning at best
- Error @ Observation.category[0] (line 7, col15) : Could not match any discriminators -- this is due to the way the profile is created. We are releasing an update today that should fixed that part
- Warning @ Observation.interpretation (line 39, col21) : None of the codes provided are in the value set -- this is due to the instance using V3 interpretation codes as suggested by the zib/profile while the base resource has an extensible binding on V2 interpretation codes. We should probably at least add a ConceptMap here and potentially consider using that to actually use what the base resource binds to. Flagged as https://bits.nictiz.nl/browse/MM-898
Grahame Grieve (Jan 27 2020 at 09:50):
the "recommended to come from a value set" message is under discussion here:
Grahame Grieve (Jan 27 2020 at 09:50):
Grahame Grieve (Jan 27 2020 at 09:51):
@Rob Hausam is the one to talk to get dutch snomed loaded on tx.fhir.org
Rob Hausam (Jan 27 2020 at 14:28):
I have a SNOMED Int. MLDS account, which theoretically should allow me to be able to download the Netherlands edition. But my credentials currently aren't giving me access to the downloads. So in lieu of getting that sorted out immediately, if someone (@Alexander Henket?) is able to provide a copy of the distribution (the current Netherlands edition snapshot or preferably the full Netherlands edition distribution) then we can get this done.
Alexander Henket (Jan 30 2020 at 11:01):
I believe @Grahame Grieve went through all that trouble and should be able to provide you with licensed access to the extension
Rob Hausam (Jan 30 2020 at 20:13):
Thanks, @Alexander Henket Yes, I'm sure that's the case. I'll ask @Grahame Grieve for it.
Last updated: Apr 12 2022 at 19:14 UTC