Open Rob5045 opened 1 month ago
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.
@mmsmits Thanks for reminding me. In Forge I had to be careful for the same reason.
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.