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

[snapshot generator] Diff validates, snapshot does not. Why? #1227

Closed
furoreSebastiaan opened this issue Jan 28, 2020 · 3 comments
Closed

[snapshot generator] Diff validates, snapshot does not. Why? #1227

furoreSebastiaan opened this issue Jan 28, 2020 · 3 comments
Assignees
Labels
support Support question

Comments

@furoreSebastiaan
Copy link

gdPerson.zip

We're encountering an issue with the snapshot generator. The differential is validated, but the snapshot is not.

we're using the 1.4 version of the validator / snapshot generator

Considerations:

  1. When removing the FregMetaData extension, the snapshot validates properly.
  2. When we make a snapshot of that extension (FregMetaData), this validates too.
  3. When adding the extension to another Person StructureDefinition (MyPerson), there are no issues.
  4. giving my MyPerson the same BaseDefinition does not result in an invalid SD.

conclusion: something in de GdPerson SD is causing the extension to build up inproperly. But I have no idea why.. Could you help us out?

@MatthijsvdWielen
Copy link

Test profling folder R4 - GitHub issue 1227.zip

The initial path is not reproducible due to version changes and package dependencies. The files in the attached zip provide a reproducible path.

This seems to be similar to issue #1153. The issue occurs only with the profiles in the attached zip, this is due to an error with the extension in the slice for addressConfidentiality.extension:

image

The culprit could be Forge that does something strange in the diff with this extension.

  • The Person.xml diff validates in Simplifier with no issues.
  • Downloading the snapshot(see snapshot in zip) from Simplifier and validating the snapshot gives errors.

It only happens with this profile, other R4 profiles that we tested did not provide the errors. Could Forge do something strange with putting and extension in the right place when it's in a slice?

Alternatively the snapshot generator on Simplifier could do something strange that causes the errors while validating the snapshot.

@marcovisserFurore
Copy link
Member

I investigated this, and it is still a problem. What did I do?

  • Validate person.xml in Simplifier: OK
  • Create a snapshot with Forge R4 and validate this with Simplifier: NOT OK
  • Created a temporarily unit test, that will make a snapshot from the sd with url http://ehelse.no/fhir/StructureDefinition/gd-Person, and then validates the outcome of the snapshot). This is actually the same as the first 2 steps. This unit test fails as well.

So I can conclude that the error is in the snapshot generator of the fhir-net-api, not in Forge or other tools. I will try to simplify the structuredefinition to pinpoint to problem. Then I create an unittest and then solve to problem. My feeling is that it somewhere has to do with the reslicing of meta.security.

@marcovisserFurore
Copy link
Member

After a long resource, I've found out that the element order of the differential is not correct. The differential looks like this:

  • <element id="Person.meta.security">
  • <element id="Person.meta.security:addressConfidentiality">
  • <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">
  • etc.

This is not correct and it should be:

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

Then the SnapshotGenerator will function correctly.

The differential is made by Forge so I have created an issue for Forge: https://firely.atlassian.net/browse/FOR-468

Because it is not a bug of the fhir-net-api, I will close this issue and we have to wait till the issue has been solved for Forge.

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

No branches or pull requests

4 participants