FHIR Chat · Validation mismatch .NET and Java · implementers

Stream: implementers

Topic: Validation mismatch .NET and Java


view this post on Zulip Thomas Tveit Rosenlund (Jun 15 2021 at 07:40):

I try to validate my resources and profiles using both the .NET implementation on SIMPLIFIER and the Java validator. However even when my profiles validate OK in SIMPLIFIER I get a lot of errors when I try to run the same validation in Java with a catalog of my StrctureDefinition as my IG.
The thing bugging me most at the moment is this one:

Unable to generate snapshot for gd-Person from no-basis-Person because Profile GdPerson (http://ehelse.no/fhir/StructureDefinition/gd-Person), element null. Error generating snapshot: Error sorting Differential: StructureDefinition http://ehelse.no/fhir/StructureDefinition/gd-Person: Differential contains path Person.extension.extension.value[x].coding.code which is actually Element.coding.code, which is not found in the in base http://ehelse.no/fhir/StructureDefinition/gd-Person
org.hl7.fhir.exceptions.DefinitionException: Profile GdPerson (http://ehelse.no/fhir/StructureDefinition/gd-Person), element null. Error generating snapshot: Error sorting Differential: StructureDefinition http://ehelse.no/fhir/StructureDefinition/gd-Person: Differential contains path Person.extension.extension.value[x].coding.code which is actually Element.coding.code, which is not found in the in base http://ehelse.no/fhir/StructureDefinition/gd-Person
        at org.hl7.fhir.r5.context.SimpleWorkerContext.generateSnapshot(SimpleWorkerContext.java:785)
        at org.hl7.fhir.r5.context.SimpleWorkerContext.generateSnapshot(SimpleWorkerContext.java:752)
        at org.hl7.fhir.r5.context.SimpleWorkerContext.allStructures(SimpleWorkerContext.java:635)
        at org.hl7.fhir.validation.ValidationEngine.prepare(ValidationEngine.java:502)
        at org.hl7.fhir.validation.cli.services.ValidationService.initializeValidator(ValidationService.java:257)
        at org.hl7.fhir.validation.cli.services.ValidationService.initializeValidator(ValidationService.java:212)
        at org.hl7.fhir.validation.ValidatorCli.doValidation(ValidatorCli.java:203)
        at org.hl7.fhir.validation.ValidatorCli.main(ValidatorCli.java:159)

I don't know what the validator is up to here as the StructureDefinition differential should be correctly generated from Forge, and I can't really se any problem with the StructureDefinition in question:

    <element id="Person.extension:citizenship.extension">
      <path value="Person.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Person.extension:citizenship.extension:code">
      <path value="Person.extension.extension" />
      <sliceName value="code" />
      <mustSupport value="true" />
    </element>
    <element id="Person.extension:citizenship.extension:code.value[x].coding.system">
      <path value="Person.extension.extension.value[x].coding.system" />
      <definition value="Grunndata - sets the system value of http://hl7.org/fhir/ValueSet/iso3166-1-3 or extension for the extended code values from FREG&#xD;&#xA;&#xD;&#xA;The identification of the code system that defines the meaning of the symbol in the code." />
      <mustSupport value="true" />
    </element>
    <element id="Person.extension:citizenship.extension:code.value[x].coding.code">
      <path value="Person.extension.extension.value[x].coding.code" />
      <alias value="Kode for statsborgerskap" />
      <mustSupport value="true" />
    </element>

The profile: https://simplifier.net/grunndata-r4/person

Any help appreciated :smile:

view this post on Zulip Grahame Grieve (Jun 15 2021 at 08:31):

I'll have to debug

view this post on Zulip Grahame Grieve (Jun 15 2021 at 22:19):

in fact, the part you quoted isn't incorrect, it's the next line

view this post on Zulip Grahame Grieve (Jun 15 2021 at 22:20):

    <element id="Person.meta.security:addressConfidentiality.system">
    <element id="Person.meta.security:addressConfidentiality.code">
    <element id="Person.meta.security:addressConfidentiality.extension">
    <element id="Person.meta.security:addressConfidentiality.extension:fregMetadata">

extension comes before system

view this post on Zulip Thomas Tveit Rosenlund (Jun 16 2021 at 08:06):

Absolutely didn't catch that. However, it does not solve the problem. I think there is really something wrong with my extended extensions again...

view this post on Zulip Thomas Tveit Rosenlund (Jun 16 2021 at 09:59):

Looks like it validates OK if I generate snapshots for the derived profiles in Forge. There is something funky about the way Forge makes differentials for derived profiles, and it could be related to those problems. I will investigate furter.


Last updated: Apr 12 2022 at 19:14 UTC