FHIR Chat · Fhir Validator and Inferno · inferno

Stream: inferno

Topic: Fhir Validator and Inferno


view this post on Zulip Marvin Greenberg (Dec 09 2020 at 18:14):

@Grahame Grieve said there is a new version of the fhirValidator (5.2.10). Inferno currently bundles 5.1.0 (iirc). The later version fixes some issues with resolving URls. We've tried just updating the build.gradle.kts to use the later dependency,

implementation("ca.uhn.hapi.fhir", "org.hl7.fhir.validation", "5.2.10")

on the https://github.com/inferno-community/fhir-validator-wrapper.git

but the docker build fails with,

#16 108.1 > Task :compileJava
#16 108.1 /home/src/main/java/org/mitre/inferno/Validator.java:22: error: package org.hl7.fhir.utilities.cache does not exist
#16 108.1 import org.hl7.fhir.utilities.cache.FilesystemPackageCacheManager;

My gradle/maven isn't very good. How can I update the bundled vlaidator for Inferno to use the later fhir validator?

Thanks!

view this post on Zulip Reece Adamson (Dec 09 2020 at 18:50):

Hey @Marvin Greenberg. We do try and keep the validator dependency up to date, but it often has API changes that make it trickier than just updating the dependency version.

Currently Inferno uses version 5.1.7 of the validator dependency. It looks like 5.1.16 (see this PR or the exact commit) renamed org.hl7.fhir.utilities.cache to org.hl7.fhir.utilities.npm. If you'd like to take a stab at updating the imports in the code I'd be happy to take a PR!

view this post on Zulip Marvin Greenberg (Dec 09 2020 at 18:58):

Alright, I'll take a stab in my copious free time. Dredge up atrophied
java skills...

view this post on Zulip Marvin Greenberg (Dec 10 2020 at 14:46):

OK @Reece Adamson afaict all test passing (for me locally) although the ci/cd to travis seems stuck. No promises bu the changes seemed simple enough
https://github.com/inferno-community/fhir-validator-wrapper/pull/28

view this post on Zulip Reece Adamson (Dec 10 2020 at 16:59):

@Marvin Greenberg Awesome, looks good from what I see! I'll give it a test drive later today so we can get this in. :party_ball:

view this post on Zulip ashoka p (Mar 02 2021 at 12:44):

I see community edition uses (fhir_models (4.1.1) gem. However when I try to validate any invalid json, i am not seeing any errors or warnings from this gem. If i provide the same invalid json to validator_cli.jar it catches those errors and displays as intended. Is there something needs to be done with this gem?
To validate cloned 'https://github.com/fhir-crucible/fhir_models' and provided an invalid json from console. No errors for the attached invalid json. patient.json

view this post on Zulip Robert Scanlon (Mar 02 2021 at 14:07):

I get the following output:

[2] pry(main)> patient = FHIR.from_contents(json)
[3] pry(main)> patient.validate
=> {"text"=>[{"div"=>["Narrative.div: <div xmlns=\"http://www.w3.org/1999/xhtml\"></p></div> is not a valid xhtml"]}]}
[4] pry(main)> patient.valid?
=> false

It isn't picking up the extra elements though as an error, which does seem like an issue.

Note that we don't typically use the fhir_models validation within Inferno, and instead use the HL7 validator (there is a configuration flag to choose which validator to use). fhir_models validation has known bugs. We chose to simply reuse the HL7 validator initially so we could focus on other things, but I would like to circle back and invest time in our fhir_models validator because using an external service adds complexity.

view this post on Zulip ashoka p (Mar 03 2021 at 04:51):

Thanks @Robert Scanlon . Yes i deliberately altered div and only that gets flagged as error from fhir-models. With correct div, i get patient.valid? as true. So atleast for now we cannot rely on fhir-models as a validator.

view this post on Zulip Robert Scanlon (Mar 03 2021 at 14:02):

It is a tradeoff on how thorough you would like your validation to be vs. how much work you want to do adding another tool outside of Ruby. In the short term, if you need validation to be fairly thorough, then I agree that you shouldn't rely on fhir-models for validation. Hopefully we can fix that though.


Last updated: Apr 12 2022 at 19:14 UTC