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

Turn Element.ElementId and Extension.Url into FHIR Primitives #2978

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

ewoutkramer
Copy link
Member

@ewoutkramer ewoutkramer commented Nov 25, 2024

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 xxxxElement properties, 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 the value property 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 the Value property 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.

⚠️ Also review and pull FirelyTeam/fhir-codegen#46, which produces the necessary changes to the generated code included in this PR.

@ewoutkramer ewoutkramer changed the title 6.0/2963 simplify simple elements Turn Element.ElementId and Extension.Url into FHIR Primitives Nov 25, 2024
@ewoutkramer ewoutkramer marked this pull request as ready for review November 25, 2024 17:29
@Kasdejong Kasdejong merged commit ce56375 into develop-6.0 Nov 26, 2024
16 checks passed
@Kasdejong Kasdejong deleted the 6.0/2963-simplify-simple-elements branch November 26, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants