Stream: implementers
Topic: Using the FHIR validator
Jean Duteau (Dec 09 2016 at 19:21):
It's my first time using the FHIR validator and I'm having two trouble points right now:
1) I have what looks like a valid Duration but the validator is complaining about my unit code of 'd': The value provided ('d') is not in the value set http://hl7.org/fhir/ValueSet/units-of-time (http://hl7.org/fhir/ValueSet/units-of-time, and a code is required from this value set)
2) I have a validator.pack generated by my IGuide and I'm specifying it on the command line but it is not handing my profile constraints. As an example, my drug prescription profile makes medicationCodeableConcept mandatory but the example I'm giving it doesn't have that.
Jean Duteau (Dec 09 2016 at 19:24):
re #2 - My example declares in the meta/profile that it is a drug prescription, but that might not be enough? I've also tried passing the profile URL on the command-line but that doesn't work:
Error @ MedicationRequest (line 3, col48) : StructureDefinition reference "StructureDefinition-canadaerx-drug-prescription.xml" could not be resolved
Grahame Grieve (Dec 09 2016 at 19:27):
hmm. units of time is problematic because it's expanded by the server, not the validator. it's my budgie for terminology service connectivity issues.
Grahame Grieve (Dec 09 2016 at 19:27):
the error suggests that you aren't passing the full profile URL
Jean Duteau (Dec 09 2016 at 19:27):
i tried both the filename and the full URL:
Error @ MedicationRequest (line 3, col48) : StructureDefinition reference "http://infoway-inforoute.ca/fhir/StructureDefinition/canadaerx-drug-prescription.xml" could not be resolved
Grahame Grieve (Dec 09 2016 at 19:28):
how are you telling the validator about the ig? or is this inside the IG?
Jean Duteau (Dec 09 2016 at 19:29):
it should be inside the IG:
java -Dfile.encoding=UTF-8 -jar ../framework/hl7files/org.hl7.fhir.validator.jar MedicationRequest-medrx0304.xml -defn igpack.zip -ig validator.pack -profile http://infoway-inforoute.ca/fhir/StructureDefinition/canadaerx-drug-prescription.xml
Jean Duteau (Dec 09 2016 at 19:29):
where the validator.pack has been produced by the IGPublisher
Grahame Grieve (Dec 09 2016 at 19:36):
that should work
Grahame Grieve (Dec 09 2016 at 21:17):
ok, just checked in a few fixes. Wait for build 10546 to be built, and then try again with that validator. Also note that the canonical URL does not include the .xml
Eric Haas (Dec 10 2016 at 20:58):
I thought this should work but it doesn't :
java -jar /Users/ehaas/Downloads/validator/org.hl7.fhir.validator.jar ${f} -defn "${path}"/output/definitions.xml.zip
Where the definitions.xml.zip is generated by the IG.
${f} is an an xml example instance
get this:
*FAILURE* validating /Users/ehaas/Documents/FHIR/US-Meds/examples/meddispense-1.xml: error:1 warn:0 info:0
Fatal @ MedicationDispense (line 1, col49) : This does not appear to be a FHIR resource (unknown namespace/name
'http://hl7.org/fhir::MedicationDispense')
looking at Jean's stuff it looks like I am missing something but I must confess haven't seen that documented anywhere. Looked here : http://build.fhir.org/validation.html#jar
Eric Haas (Dec 10 2016 at 20:58):
the bit about "validator.pack" Oh and the sample xml is valid.
Grahame Grieve (Dec 10 2016 at 21:08):
your validator is missing the base definitions?
Eric Haas (Dec 11 2016 at 16:53):
thanks for the updated documentation at : http://build.fhir.org/validation.html#jar
Eric Haas (Dec 11 2016 at 18:59):
Sweet! this works for local validation of IG examples.....
java -jar [path]/org.hl7.fhir.validator.jar my-example.xml -defn [path]/igpack.zip -ig [path]/validator.pack
but I get this warning:
Warning @ MedicationDispense.medicationCodeableConcept (line 9, col29) : ValueSet http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes not found
Since that is a dependency in the IG - am I missing something?
Grahame Grieve (Dec 11 2016 at 19:58):
maybe I should include the dependent packs in the other pack so there's no need to chase them in the validator
Eric Haas (Dec 11 2016 at 20:08):
so validator.pack would contains the dependencies ?
Grahame Grieve (Dec 11 2016 at 20:09):
yes it would. As it is now, you have to find it and supply the reference, and you might get the wrong vrsion
Vikas Mittal (Jun 15 2017 at 02:03):
Hi @Grahame Grieve
I am using the following command with the official FHIR Validator from https://www.hl7.org/fhir/downloads.html
...
java -jar org.hl7.fhir.validator.jar dh-Patient-base-example-Max.xml -defn definitions.xml.zip -profile http://pyrohealth.net/test/stu3/fhir/StructureDefinition/8517d4e9-f668-43e7-9c82-85cd2d7011c9 -output PublishedOutput004.xml
...
I am getting the following error as in the attached snapshot
2017-06-15_115927.jpg
I am concerened about this error >>> StructureDefinition reference "http://pyrohealth.net/test/stu3/fhir/StructureDefinition/8517d4e9-f668-43e7-9c82-85cd2d7011c9" could not be resolved
What is the reason I am getting this error ?
Thanks.
Grahame Grieve (Jun 15 2017 at 04:18):
because the validator doesn't know about it
Vikas Mittal (Jun 15 2017 at 04:31):
Thanks @Grahame Grieve . can you please give some more hint as where/which file to look into and probably what part can be having error. or may be any link of the documentation in relation to such errors.
As I did add the "-profile http://pyrohealth.net/test/stu3/fhir/StructureDefinition/8517d4e9-f668-43e7-9c82-85cd2d7011c9" parameter in the command line while running the validator.
Grahame Grieve (Jun 15 2017 at 04:33):
then it should be resolved. I'd have to debug it to know what's the problem
Vikas Mittal (Jun 15 2017 at 04:34):
Thanks Grahame. Do you need the patient xml file which I used?
Vikas Mittal (Jun 15 2017 at 04:37):
attaching here for your reference anyway. Cheers.
dh-Patient-base-example-Max.xml
Last updated: Apr 12 2022 at 19:14 UTC