Turn Element.ElementId and Extension.Url into FHIR Primitives - #2978
Merged
Conversation
# Conflicts: # src/Hl7.Fhir.Base/Model/Generated/Element.cs # src/Hl7.Fhir.Base/Model/Generated/Extension.cs
ewoutkramer
marked this pull request as ready for review
November 25, 2024 17:29
Kasdejong
approved these changes
Nov 26, 2024
This was referenced Oct 15, 2025
This was referenced Nov 24, 2025
This was referenced Dec 1, 2025
This was referenced Aug 5, 2026
This was referenced Aug 6, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes sure that all FHIR properties on the POCO's are now FHIR types, and no longer .NET types (which Element.ElementId and Extension.Url were). This was, interestingly, not a breaking change to the POCOs, since the only thing I needed to do was to add
xxxxElementproperties, turning the original primitive properties into the usual "helper" properties. As such, there is compile-time compatibility.What did change was the fact that
GetElementPairs()now no longer returns .NET primitives, but always either a Base subclass or a List of Base. Also,GetElementPairs()will not list thevalueproperty of primitives anymore, as from now on the FHIR Primitives are considered to be the leaves in the tree (just like in ITypedElement), and one can easily access theValueproperty of the Primitive.These last two changes required me to update the POCO serializers/deserializers and the PocoBuilders. Also, quite a few unit tests (that tested the old behaviour) had to be updated.
Breaking changes
There is a slight breaking change (which we don't need to document), in that one of the errors will not be thrown anymore, as there are no longer Poco properties that are just .NET primitives. I removed that error from the public surface, since it cannot be raised anymore.
Fixes #2963.