FHIR Chat · java validator bugs? · implementers

Stream: implementers

Topic: java validator bugs?


view this post on Zulip Patrick Werner (Jun 12 2019 at 13:18):

1. When validating a whole folder each file should be validated if it is a valid resource. I just tested it and had some tsv(csv) files in the folder and got:

[Fatal Error] :1:1: Content is not allowed in prolog.
     .. not a resource: ./12345_789_somatic_snv.tsv
Exception in thread "main" java.lang.Exception: Unable to find/resolve/read -ig ./12345_789_somatic_snv.tsv
        at org.hl7.fhir.r5.validation.ValidationEngine.loadIgSource(ValidationEngine.java:446)
        at org.hl7.fhir.r5.validation.ValidationEngine.loadContent(ValidationEngine.java:780)
        at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:812)
        at org.hl7.fhir.r5.validation.Validator.main(Validator.java:436)

2. I also get a stack trace on syntax errors:

Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Unable to find type Count for element valueCount with path Observation.component.value[x]
        at org.hl7.fhir.r5.elementmodel.Property.getChildProperties(Property.java:309)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parseChildren(XmlParser.java:241)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parseChildren(XmlParser.java:317)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parseChildren(XmlParser.java:317)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parse(XmlParser.java:178)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parse(XmlParser.java:162)
        at org.hl7.fhir.r5.elementmodel.XmlParser.parse(XmlParser.java:134)
        at org.hl7.fhir.r5.validation.InstanceValidator.validate(InstanceValidator.java:586)
        at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:902)
        at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:816)
        at org.hl7.fhir.r5.validation.Validator.main(Validator.java:436)

it would be better to catch these, report the error and continue with the validation

view this post on Zulip Patrick Werner (Jun 12 2019 at 13:30):

3.: for every example file i get:

error: Read off end of file: 4642092 / 2147483596:7

view this post on Zulip Grahame Grieve (Jun 12 2019 at 13:35):

the first error is - I try to read unknown files in case they are resources, and the xml library generates that log message internally

view this post on Zulip Grahame Grieve (Jun 12 2019 at 13:36):

I don't know what's with the second or third - can I reproduce?

view this post on Zulip Patrick Werner (Jun 18 2019 at 12:19):

error 1: the validator exits after the stacktrace, would be nice to catch that parser exception
error 2: Observation doesn't allow valueCount which was used here
error 3: i've attached the example causing the error NGS_ObsVariant_SNV_12345_009_FGFR1.xml

view this post on Zulip Patrick Werner (Jun 18 2019 at 12:21):

validated with latest java validator: "java -jar ~/Downloads/org.hl7.fhir.validator.jar . -version 4.0.0"

view this post on Zulip Patrick Werner (Jun 18 2019 at 14:10):

Found another improvable Error message:
Element 'Observation.component[10].valueCodeableConcept.system': minimum required = 1, but only found 0
Here the profile constrains component.value[x] to Quantity, the validator doesn't recognize the wrong data type.


Last updated: Apr 12 2022 at 19:14 UTC