Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SnapshotGenerator] Adding a type slice to an already closed slice should give an error #328

Open
mmsmits opened this issue Dec 9, 2019 · 1 comment

Comments

@mmsmits
Copy link
Member

mmsmits commented Dec 9, 2019

Test created: Test_obs1_2

baseProfile:

<differential>
    <element>
      <path value="Observation.value[x]" />
      <slicing>
        <rules value="closed" />
      </slicing>
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element>
      <path value="Observation.value[x]" />
      <sliceName value="valueCodeableConcept" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://somewhere/something" />
      </binding>
    </element>
  </differential>

profile on Profile:

<differential>
    <element>
      <path value="Observation.value[x]" />
      <slicing>
        <rules value="closed" />
      </slicing>
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element>
      <path value="Observation.value[x]" />
      <sliceName value="valueQuantity" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://somewhere/something-else" />
      </binding>
    </element>
  </differential>

Should give an error, because the baseProfile already defined a typeSlice (closed), but the snapshot generator generates a faulty snapshot with both slices in it, where it should give an error that you can't add a slice to closed slicing array.

@mmsmits mmsmits added the bug label Dec 9, 2019
@mmsmits mmsmits changed the title [SnapshotGenerator] Adding a type slice to an already closed slice, should give an error [SnapshotGenerator] Adding a type slice to an already closed slice should give an error Dec 9, 2019
@mmsmits mmsmits transferred this issue from FirelyTeam/firely-net-sdk Jun 27, 2024
@mmsmits
Copy link
Member Author

mmsmits commented Jun 27, 2024

This issue triggers multiple problems:

  1. IResourceResolver can't report any issues when trying to resolve an artifact meaning we can't communicate any issues from the SnapshotGenerator to the user. Extend IResourceResolver with the ability to also report back issues firely-net-sdk#2808
  2. This issue results in a faulty snapshot, we could report this during generation. Normally we let the validator do this, but not all users validate their StructureDefinitions.
  3. If we want to validate this using the validator-api, we need to add a looooot of extra logic -> A ElementDefinitionNavigator-like class on ITypedElement to have all the slice logic and being able to resolve the base and using that for validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants