Stream: implementers
Topic: Validator - trouble loading custom profiles
Morten Ernebjerg (Aug 28 2018 at 13:59):
I am using the newest validator from https://build.fhir.org/downloads.html and want to validate STU3 resources against custom profiles. Using just the standard validation works fine (here for a file in the directory of the validator)
java -jar org.hl7.fhir.validator.jar -version 3.0.1 ./patient-example.xml
Then I add a Patient profile (just the StructureDefinition
resource as XML, not a full IG) in the sub-directory profiles. Now I want to the validator to load this profile and validate against it. As a test, suppose that I added the standard Patient resource definition, (https://www.hl7.org/fhir/patient.profile.xml). So I run
java -jar org.hl7.fhir.validator.jar -version 3.0.1 ./patient-example.xml -ig profiles/ -profile http://hl7.org/fhir/StructureDefinition/Patient
This gives the following error:
(v3.0.1-null) + .. load IG from profiles/ Exception in thread "main" java.lang.Exception: Error parsing patient.profile.xml: Unknown Content valueSetReference @ START_TAG seen ...escription value="A human language."/>\n <valueSetReference>... @939:28 at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:670) at org.hl7.fhir.r4.validation.Validator.main(Validator.java:341) Caused by: org.hl7.fhir.exceptions.FHIRFormatError: Unknown Content valueSetReference @ START_TAG seen ...escription value="A human language."/>\n <valueSetReference>... @939:28 at org.hl7.fhir.r4.formats.XmlParserBase.unknownContent(XmlParserBase.java:279) at org.hl7.fhir.r4.formats.XmlParser.parseElementDefinitionElementDefinitionBindingComponent(XmlParser.java:1888) at org.hl7.fhir.r4.formats.XmlParser.parseElementDefinitionContent(XmlParser.java:1701) at org.hl7.fhir.r4.formats.XmlParser.parseElementDefinition(XmlParser.java:1626) at org.hl7.fhir.r4.formats.XmlParser.parseStructureDefinitionStructureDefinitionSnapshotComponentContent(XmlParser.java:19497) at org.hl7.fhir.r4.formats.XmlParser.parseStructureDefinitionStructureDefinitionSnapshotComponent(XmlParser.java:19486) at org.hl7.fhir.r4.formats.XmlParser.parseStructureDefinitionContent(XmlParser.java:19418) at org.hl7.fhir.r4.formats.XmlParser.parseStructureDefinition(XmlParser.java:19357) at org.hl7.fhir.r4.formats.XmlParser.parseResource(XmlParser.java:23323) at org.hl7.fhir.r4.formats.XmlParserBase.parse(XmlParserBase.java:105) at org.hl7.fhir.r4.formats.XmlParserBase.parse(XmlParserBase.java:89) at org.hl7.fhir.r4.validation.ValidationEngine.loadIg(ValidationEngine.java:659) ... 1 more
This error occurs even after removing the -profile
parameter, so it seems to be related to the initial loading of the profile. Playing with the -tx
and -version
parameters does not change anything, either. I tried various different profiles and always see this error (always comaplaining about the same field in the StructureDefinition), yet loading profiles from a directory used to work fine and as far as I could tell from the validator wiki page, it is still supported. Did anything change or am I just missing something?
Lloyd McKenzie (Aug 28 2018 at 15:21):
@Grahame Grieve ?
Grahame Grieve (Aug 29 2018 at 03:51):
the question is why it's reading it as an r4 profile, not an r3 profile. I'll have to have a look tonight
Morten Ernebjerg (Sep 05 2018 at 13:49):
Hi @Grahame Grieve - was this resolved (or a workaround found)?
Grahame Grieve (Sep 05 2018 at 13:54):
no. sorry. I'll work on it tomorrow
Morten Ernebjerg (Sep 07 2018 at 11:58):
OK, thanks! - using the STU3 validator meanwhile.
Last updated: Apr 12 2022 at 19:14 UTC