You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ℹ️ Do you want to ask something or start a discussion, then go here.
ℹ️ Is your feature request about Firely Server Facade, please send an email to [email protected] or submit a feature request to Jira if you are a paying customer.
ℹ️ If your feature request concerns the validator, please submit your issue to the validator repository here.
Is your feature request related to a problem? Please describe.
I am still not too familiar with how the deserializer determines different data types on Extensions, but I am assuming it is the suffix after value. For example, when an Extension has a field called valueString, it will deserialize the value as a string. Similarly, when the Extension has a field called valueCodeableConcept, it will deserialize the value as a CodeableConcept.
When I try to deserialize a field called valueDateTime, I would imagine it should deserialize the value as DateTime, but the serializer instead throws an error:
"Choice element 'value' is suffixed with an unrecognized type 'DateTime'."
Describe the solution you'd like
I would like the deserializer to be able to deserialize that field into a DateTime/FhirDateTime. I am currently using System.Text.Json, have not yet tested Newtonsoft.
Describe alternatives you've considered
I have considered creating a custom resource to support this, but it seems a little bit more involved because the Extension concept appears baked into the DomainResource base class.
Additional context
Example Extension that throws an error
After doing a little more testing, I think this expands beyond just valueDateTime, and I am curious how the Extension determines whether the value is deserializable or not. For example, it looks like valuePeriod and valueQuantity also do not work, even though they appear to be valid data types?
ℹ️ Do you want to ask something or start a discussion, then go here.
ℹ️ Is your feature request about Firely Server Facade, please send an email to [email protected] or submit a feature request to Jira if you are a paying customer.
ℹ️ If your feature request concerns the validator, please submit your issue to the validator repository here.
Is your feature request related to a problem? Please describe.
I am still not too familiar with how the deserializer determines different data types on Extensions, but I am assuming it is the suffix after
value
. For example, when an Extension has a field calledvalueString
, it will deserialize the value as a string. Similarly, when the Extension has a field calledvalueCodeableConcept
, it will deserialize the value as aCodeableConcept
.When I try to deserialize a field called
valueDateTime
, I would imagine it should deserialize the value asDateTime
, but the serializer instead throws an error:Describe the solution you'd like
I would like the deserializer to be able to deserialize that field into a
DateTime
/FhirDateTime
. I am currently usingSystem.Text.Json
, have not yet testedNewtonsoft
.Describe alternatives you've considered
I have considered creating a custom resource to support this, but it seems a little bit more involved because the
Extension
concept appears baked into theDomainResource
base class.Additional context
Example Extension that throws an error
The text was updated successfully, but these errors were encountered: