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

Redo primitive deserialization code to use no-param constructors #59

Open
ewoutkramer opened this issue Jun 16, 2021 · 2 comments
Open
Labels
Firely Issues related to Firely Language

Comments

@ewoutkramer
Copy link
Contributor

Currently, we need to have specific constructors for each primitive, but we can also use the no-param constructors and then set the ObjectValue. This will allow us to keep track of invalid values too.

@GinoCanessa GinoCanessa added the Firely Issues related to Firely Language label Jun 16, 2021
@ewoutkramer
Copy link
Contributor Author

I double checked the code in the SDK: all primitives have a Value property (that is no news) that casts an underlying ObjectValue property to the desired primitive type. This means our parsers and serializers can just read/set that ObjectValue instead of having to call the correct constructor.

@ewoutkramer
Copy link
Contributor Author

Note that this will allow the parsers to parse 'illegal' values and store then in the FHIR primitive POCOs. The current "slow" POCO parser checks that the input is in the correct format before setting the property - but we might want to deal with that differently.

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

No branches or pull requests

2 participants