Stream: implementers
Topic: Validator
Vadim Peretokin (Apr 13 2017 at 14:29):
I'm looking at validating resources I've made against profiles and valuesets available on my filesystem, and the validator is erroring out with:
"FHIRException: fetching org.hl7.fhir.dstu3.model.StructureDefinition not done yet for URI 'https://BLAH-DOMAIN.VAR/fhir/StructureDefinition/my-extension'"
I have BLAH-DOMAIN.VAR in there as a placeholder for the final Canonical URL. How can I make it ignore resolving it and use what's on my filesystem instead?
And, a second question, can it search the filesystem at all or does everything have to be in one folder for it to resolve?
Lloyd McKenzie (Apr 13 2017 at 14:43):
You can pass the validator a validator.pack that contains the structure definitions you want it to be aware of when validating. A validator.pack is basicly a zip file of structure definitions and vocabulary resources plus a version.info file - you can look at one from any of the published implementation guides to see what they look like.
Vadim Peretokin (Apr 13 2017 at 14:48):
Brilliant thanks, will try
Vadim Peretokin (Apr 13 2017 at 14:50):
Is JSON supported now? README says that it's not, but US Core uses json valuesets
Vadim Peretokin (Apr 13 2017 at 14:50):
It uses JSON everything really. I guess it is supported
Vadim Peretokin (Apr 13 2017 at 14:56):
Do I pass the validator.pack as the last argument?
Eric Haas (Apr 13 2017 at 15:00):
The validation packs are json but the validator only validates xml instances. also there may be an issue with parsing the validator pack from us-core that is discussed here
Lloyd McKenzie (Apr 13 2017 at 15:15):
I didn't know the validator only validates XML instances. There's no reason why that *should* be the case. If it's still true, please lodge a tracker item.
Lloyd McKenzie (Apr 13 2017 at 15:15):
@Vadim Peretokin Order of arguments doesn't matter. Just specify -ig followed by space followed by the name (and possibly relative or absolute path) to the IG pack
Eric Haas (Apr 13 2017 at 15:18):
last time I used it was only xml, but it would be great if does both. Let me know.
Vadim Peretokin (Apr 14 2017 at 08:04):
It now says + .. load IG from validator.zip
and now errors fetching the base profile that the resources' profile derives from, even though the base profile is inside the validation zip.
Vadim Peretokin (Apr 14 2017 at 08:06):
@Eric Haas would you know if it can load base profiles that are inside the validation zip?
I've double-checked and my setup looks right
Vadim Peretokin (Apr 14 2017 at 09:14):
Pretty much flailing here. The error messages are confusing. I've put my profile into the validation zip, I point it at the validation zip, it loads the zip but when it tries to validate, it can't find the profile. I've triple-checked that the meta.profile
matches StructureDefinition.url
Lloyd McKenzie (Apr 15 2017 at 06:15):
Does the URL of your StructureDefinition agree with the id?
Grahame Grieve (Apr 15 2017 at 21:42):
should work. can you send me the set up so I can debug?
Grahame Grieve (Apr 15 2017 at 21:42):
and validator supports json everything now. I just have to fix the read me
Eric Haas (Apr 15 2017 at 21:52):
not working for me either anymore.... here is what I am using on the command line:
java -jar /Users/ehaas/Downloads/validator/org.hl7.fhir.validator.jar ${fs} -defn /Users/ehaas/Downloads/igpack.zip -ig "${path}"/output/validator.pack
Eric Haas (Apr 15 2017 at 21:53):
getting an ig.pack error. (note the link is broken in the CI build - using the STU3 version)
Eric Haas (Apr 15 2017 at 21:53):
.. load FHIR from /Users/ehaas/Downloads/igpack.zip
.. connect to tx server @ http://fhir3.healthintersections.com.au/open
Exception in thread "main" org.hl7.fhir.exceptions.FHIRFormatError: Error parsing extension-definitions.xml:Unknown
Content type @ START_TAG seen ...<discriminator>\n <type value="value"/>... @94:38
at org.hl7.fhir.dstu3.context.SimpleWorkerContext.loadFromFile(SimpleWorkerContext.java:169)
Eric Haas (Apr 15 2017 at 22:01):
lately I've been using the ig-publisher to validate instances. ( add em in the examples folder and inspect the qa.html ) So I haven't used this tool in a while.
Grahame Grieve (Apr 19 2017 at 05:54):
so I just tried this, and it works for me - I used the current igpack, and the current validator from us core, and I had no problems validating one of the US core examples.
Eric Haas (Apr 19 2017 at 16:37):
Yes sorry its working - I forgot to unzip the latest validator so I was using the old one. I works fine on my source xml examples but creates this mess on my source json examples....
Eric Haas (Apr 19 2017 at 16:41):
Erics-Air-2:US-Core ehaas$ bash validate2.sh ================================================================= === Validate US-Core IG!!! Wed Apr 19 16:32:46 UTC 2017 === ================================================================= Type the file name of the resource that you want to check: imm-1.json validating /Users/ehaas/Documents/FHIR/US-Core/examples/imm-1.json... .. load FHIR from /Users/ehaas/Downloads/igpack.zip .. connect to tx server @ http://fhir3.healthintersections.com.au/open (v3.0.0-11828) + .. load IG from /Users/ehaas/Documents/FHIR/US-Core/output/validator.pack .. validate *FAILURE* validating /Users/ehaas/Documents/FHIR/US-Core/examples/imm-1.json: error:2 warn:0 info:0 Error @ Immunization.vaccineCode.coding[1] (line 8, col5) : Error org.hl7.fhir.dstu3.utils.client.EFhirClientException: Error unmarshalling resource: No Database Connections Available for "Operation/Search" (used: InUse 100 of 100: fhir.sweep 9hr (update IndexEntries set Flag = 2 where ResourceKey in (select ResourceKey from Ids where MasterResourceKey = 123743)),Operation/Search 9hr (select Resou.....
Eric Haas (Apr 19 2017 at 16:42):
...with about a hundred more lines of error message stuff
Eric Haas (Apr 19 2017 at 16:45):
So it looks like the ig-publisher fixed my bad json? Is it supposed to do that?
Eric Haas (Apr 19 2017 at 16:59):
The source json examples are missing '[]' and they magically appear in the output files....
Eric Haas (Apr 19 2017 at 17:01):
On another note.. Why the loads of text when the validator errors? Its overwhelming and unhelpful...
Grahame Grieve (Apr 21 2017 at 02:32):
that error is a server side error - my server was broken. try again...
Andrew Cho (Apr 08 2021 at 03:50):
Hello, I was hoping someone would be able to explain slices and extensions. The validator is flagging this part of my EOB Professional JSON: Screen-Shot-2021-04-07-at-11.47.11-PM.png
The error I get is:
Error @ ExplanationOfBenefit.item[0].adjudication[1].category (line 244, col36) : None of the codings provided are in the value set http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBAdjudicationCategoryDiscriminator (http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBAdjudicationCategoryDiscriminator), and a coding from this value set is required) (codes = http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBPayerAdjudicationStatus#innetwork).
Any help in resolving this would be appreciated.
Daniel Mechanik (Apr 08 2021 at 07:45):
Are you validating against an implementation guide?
I used to get this error when referencing ValueSets that are not accessible to the validator. It was solved once I started to validate with the -IG parameter. You don't really need an IG resource there, you can put a folder that holds all the ValueSet, CodeSystem, StructureDefinition resource files.
Andrew Cho (Apr 08 2021 at 13:37):
@Daniel Mechanik , I am using this for the ig param: -ig http://hl7.org/fhir/us/carin-bb/
Andrew Cho (Apr 08 2021 at 13:50):
To add some more context, I based the part of the json on an example from the EOB Professional profile on the hl7 website.
Lloyd McKenzie (Apr 08 2021 at 15:31):
The error you're getting isn't related to slices or extensions. It's saying that adjudication.category is supposed to draw from a specific set of codes and in your instance, you're not drawing from that set of codes.
Last updated: Apr 12 2022 at 19:14 UTC