Stream: Covid-19 Response
Topic: Validator failure
David Pyke (May 13 2020 at 21:06):
URL value "http://hl7.org/fhir/us/saner/Measure/CDCPatientImpactAndHospitalCapacity" does not resolve
sean zitello (May 13 2020 at 21:17):
URL value 'http://hl7.org/fhir/us/saner/Measure/FEMADailyHospitalCOVID19Reporting' does not resolve
sean zitello (May 13 2020 at 21:20):
@Davd: Do you also receive these Warnings for CDC: None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/measure-population (http://hl7.org/fhir/ValueSet/measure-population, and a code should come from this value set unless it has no suitable code) (codes = http://hl7.org/fhir/us/saner/CodeSystem/MeasurePopulationSystem#numBedsOcc
Reece Adamson (May 13 2020 at 21:22):
@David Pyke could you share the resource (or a pointer to the example if its in the IG) you are trying to validate on https://infernotest.healthit.gov/validator/?
David Pyke (May 13 2020 at 21:23):
https://drive.google.com/open?id=10n0Gg3Zg2VuIaTQ6iW-bZ8Ilyga9w_Cu
David Pyke (May 13 2020 at 21:23):
It's the Epic JSON one in the sample dir in the gdrive
David Pyke (May 13 2020 at 21:24):
Validating against the public health measure report
Reece Adamson (May 13 2020 at 21:24):
Gotcha, thanks! Looking into it now...
sean zitello (May 13 2020 at 21:49):
Measure definition for CDCPatientImpactAndHospitalCapacity: 1. Is the second population code "numbeds" (SERVER) or "numBeds" (IG:definitions.zip). 2. Should each population.code.coding include a code from http://terminology.hl7.org/CodeSystem/measure-population". Only the first population has this for CDC, but all do for FEMA and they do not throw validation warnings.
Reece Adamson (May 14 2020 at 12:40):
@David Pyke we were able to fix the error last night (we were mounting a volume into the docker container in production that was overwriting some things it shouldn't have). I was able to validate the example MeasureReport you provided and a Measure example from the spec against the PublicHealthMeasure Profile.
@Keith Boone This issue made me noticed that the PublicHealthMeasureReport.subject
is a reference to a US Core Profile not a SANER Resource Location Profile. Is that intentional? The SANER Resource Location Profile is based off the US Core Profile so I figure this might be an oversight.
David Pyke (May 14 2020 at 12:42):
So how are you able to validate against "measure": "http://hl7.org/fhir/us/saner/StructureDefinition/PublicHealthMeasure", when the HL7 FHIR Validator can't?
Reece Adamson (May 14 2020 at 12:51):
We load the resources into the validator directly. Typically, the desktop validator retrieves the IG resources from the package registry and stores them locally (~/.fhir
by default). The SANER IG is not in the package registry (packages.fhir.org) though.
You could probably load them in there yourself, but the better way to do it with the desktop jar would be to pass the directory of containing the IGs if you want to use the desktop jar:
i.e.
-ig hl7.fhir.us.saner#current
flag tells the validator to look for the ig in packages.fhir.org
-g ./my-dir
flag tells the validator to look for the ig in the my-dir
directory (I didn't try this locally so there might be a syntax error, but you can read more in the validator docs here: (https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator look at the Loading an Implementation Guide
section.)
We're using the same HL7 validator code (source here), just wrapped in a web service which reduces some of the jar initialization overhead and makes it accessible over the web.
Reece Adamson (May 14 2020 at 12:53):
Hopefully that helps. We use, and appreciate, the validator a lot so I can try and help troubleshoot more if you'd like. Also, if there is a feature of the web based validator that you'd like to see let us know and we can try and add it (source for that is on GitHub too)!
David Pyke (May 14 2020 at 13:21):
The command I'm using is
java -jar ./org.hl7.fhir.validator.jar -ig hl7.fhir.us.saner#current -version 4.0.1 [File]
Reece Adamson (May 14 2020 at 13:40):
Here's an example to show you what I mean.
All examples are performed against this resource to keep us on the same page: cdc-patient-impact.json
TLDR: Download the IG and use java -jar ./org.hl7.fhir.validator.jar -ig [IG Folder] -version 4.0.1 [File]
More details:
Package Registry Method (the command you're using)
This is the command you are using:
java -jar ./org.hl7.fhir.validator.jar -ig hl7.fhir.us.saner#current -version 4.0.1 cdc-patient-impact.json
Gives: Error @ Measure.url (line 13, col86) : URL value "http://hl7.org/fhir/us/saner/Measure/CDCPatientImpactAndHospitalCapacity" does not resolve
Because SANER is not on packages.fhir.org
Local Method
java -jar ./org.hl7.fhir.validator.jar -ig ./definitions.json -version 4.0.1 cdc-patient-impact.json
This will work. Note that I use -ig ./definitions.json
which is the directory containing the IG resources
David Pyke (May 14 2020 at 13:42):
Okay, thank you. I'll fix it.
Reece Adamson (May 14 2020 at 13:44):
@David Pyke I'd appreciate your feedback, if you have any, on infernotest.healthit.gov/validator and what features would make it more useful to you. As a completely open source project we define success on others using it and it being useful to them. The UI is a little rough, but feedback from folks like yourself helps us determine what to work on or whether its worth working on at all.
David Pyke (May 14 2020 at 14:36):
It would be very nice if it could pull the profile from the meta tag, if it exists, rather than me selecting it.
Grahame Grieve (May 14 2020 at 19:23):
It would be very nice if it could pull the profile from the meta tag, if it exists
it does
Grahame Grieve (May 14 2020 at 19:24):
@Reece Adamson this command
java -jar ./org.hl7.fhir.validator.jar -ig hl7.fhir.us.saner#current -version 4.0.1 [File]
that works fine. Your method of downloading the igs does not work. Please do not use or recommend it
Reece Adamson (May 14 2020 at 19:57):
Noted. sorry about that, I thought it was a valid option based on the docs.
sean zitello (May 26 2020 at 20:27):
Reece Adamson said:
Here's an example to show you what I mean.
All examples are performed against this resource to keep us on the same page: cdc-patient-impact.json
TLDR: Download the IG and use
java -jar ./org.hl7.fhir.validator.jar -ig [IG Folder] -version 4.0.1 [File]
More details:
Package Registry Method (the command you're using)
This is the command you are using:
java -jar ./org.hl7.fhir.validator.jar -ig hl7.fhir.us.saner#current -version 4.0.1 cdc-patient-impact.json
Gives:
Error @ Measure.url (line 13, col86) : URL value "http://hl7.org/fhir/us/saner/Measure/CDCPatientImpactAndHospitalCapacity" does not resolve
Because SANER is not on packages.fhir.org
Local Method
java -jar ./org.hl7.fhir.validator.jar -ig ./definitions.json -version 4.0.1 cdc-patient-impact.json
This will work. Note that I use
-ig ./definitions.json
which is the directory containing the IG resources
Hi Reese, I didn't realize you answered this ... Thanks, so much.
Followup: is there some doc maybe that would help me understand what parts of validation fail when package is not on packages.fhir.org. How many of the .contained zip files would I expect to have uncompress when using a local IG?
Reece Adamson (May 27 2020 at 15:05):
@sean zitello Do not use this approach. I had assumed this would work based on the validator documentation here, but this is not the case. I am unable to edit my original post to clarify that advice.
This is probably a question for @Grahame Grieve: What is the best way to validate resources against an IG that is not on packages.fhir.org?
Keith Boone (May 28 2020 at 15:13):
Or even better, what's the best way to get the IG into packages.fhir.org?
Jose Costa Teixeira (May 28 2020 at 15:37):
Reece Adamson said:
What is the best way to validate resources against an IG that is not on packages.fhir.org?
I presume that once you get the package into your local cache, the validator can use it.
Noemi Deppenwiese (May 28 2020 at 15:45):
Reece Adamson said:
sean zitello Do not use this approach. I had assumed this would work based on the validator documentation here, but this is not the case. I am unable to edit my original post to clarify that advice.
I regularly use the validator with local folders instead of packages. I have all conformance resources in one flat folder and point it to that. Maybe the .json in the folder name confuses the validator?
Grahame Grieve (Jun 05 2020 at 01:42):
maybe. what's the stack?
Grahame Grieve (Jun 05 2020 at 01:42):
you can get your packages into packages.fhir.org by publishing and registering an RSS feed like http://hl7.org/fhir/packages-feed.xml
Grahame Grieve (Jun 05 2020 at 01:43):
or you can upload via simplifier if you have an account
Reece Adamson (Jun 05 2020 at 19:12):
Is there a way to validate with the desktop jar against a local IG without having to use packages.fhir.org?
Keith Boone (Jun 06 2020 at 16:18):
I could point to a lot of feeds that gave: HL7 - 404 File Not Found, but I don't think that's what you meant @Grahame Grieve
Where would such a feed be registered to?
Grahame Grieve (Jun 06 2020 at 20:31):
you register the feed in https://github.com/FHIR/ig-registry/blob/master/fhir-ig-list.json
Grahame Grieve (Jun 06 2020 at 20:32):
@Reece Adamson - that depends on what exactly you are doing. Do you mean by 'local' that you built it locally?
Rob Eastwood (Jun 06 2020 at 22:20):
Reece Adamson said:
Is there a way to validate with the desktop jar against a local IG without having to use packages.fhir.org?
If it helps any, you can validate against a locally built IG by referring to its output validator pack file. As a demonstration..
- clone the HL7 BSER repostory https://github.com/HL7/bser (as an example)
- build the IG with the FHIR IG publisher (usual command
java -jar path/to/publisher.jar -ig ig.ini
) - note the generated output file
validator-bser.pack
(which doesn't exist without the previous step) - then from the root directory of the BSER IG, validate a random example against a corresponding profile, with this command
java -jar path/to/validator.jar -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig output/validator-bser.pack -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis
So for your locally built IG, find the corresponding pack file in the output folder and use that for the -ig
switch .
Grahame Grieve (Jun 07 2020 at 01:18):
this does work, though at some stage the .pack will be removed - it's deprecated. An alternative way to go about this:
- clone the HL7 BSER repostory https://github.com/HL7/bser (as an example)
- build the IG with the FHIR IG publisher (usual command java -jar path/to/publisher.jar -ig ig.ini)
- from any directory, validate a random example against a corresponding profile, with this command
java -jar path/to/validator.jar -version 4.0.1 input/resources/condition/condition-BS -ig hl7.fhir.us.bser#dev
The #dev says to use the local build that you did. Though this will also work:
java -jar path/to/validator.jar -version 4.0.1 input/resources/condition/condition-BSeR-Diagnosis-eve-everywoman-diabetes.xml -ig output/package.tgz -profile http://hl7.org/fhir/us/bser/StructureDefinition/BSeR-Diagnosis
Package.tgz has replaced validator.pack
Rob Eastwood (Jun 07 2020 at 08:44):
Excellent; thank you very much @Grahame Grieve for the improved options.
Last updated: Apr 12 2022 at 19:14 UTC