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 does not merge Element.Id value for element definition properties. #2839

Open
Rob5045 opened this issue Aug 14, 2024 · 2 comments
Assignees
Labels

Comments

@Rob5045
Copy link
Contributor

Rob5045 commented Aug 14, 2024

Almost all element definition properties have Element as base type. It looks like Element.Extensions is merged for all properties but Element.Id is not merged at all.

Source code: SnapshotGenerator -> ElementDefnMerger.

For example: mergeBinding

snap.StrengthElement = mergePrimitiveElement(snap.StrengthElement, diff.StrengthElement);
snap.DescriptionElement = mergePrimitiveElement(snap.DescriptionElement, diff.DescriptionElement);
snap.ValueSetElement = mergeComplexAttribute(snap.ValueSetElement, diff.ValueSetElement);
snap.Extension = mergeExtensions(snap.Extension, diff.Extension);
snap.Additional = mergeCollection(snap.Additional, diff.Additional, matchExactly);

Example resource:
MyObservation.StructureDefinition.json

The result is that when loading the example resource in Forge the binding.id with value "Test" for the "Observation.category" element is still set to the value 'null' after calling SnapshotGenerator.Generate.

@Rob5045 Rob5045 added the bug label Aug 16, 2024
@Rob5045 Rob5045 self-assigned this Aug 27, 2024
@mmsmits
Copy link
Member

mmsmits commented Aug 29, 2024

Please be careful when merging Element.id, since elementDefinition has Id's that are "protected" and generated by the snapshot generator itself, and should not be merged.

@Rob5045
Copy link
Contributor Author

Rob5045 commented Aug 29, 2024

@mmsmits Thanks for reminding me. In Forge I had to be careful for the same reason.

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

No branches or pull requests

2 participants