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

Support "valueDateTime" on Extension for R4 #2832

Closed
Narnian12 opened this issue Aug 7, 2024 · 2 comments
Closed

Support "valueDateTime" on Extension for R4 #2832

Narnian12 opened this issue Aug 7, 2024 · 2 comments

Comments

@Narnian12
Copy link

ℹ️ 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

{
  "resourceType": "ClaimResponse",
  "extension": [
    {
      "url": "http://google.com",
      "valueDateTime": "2024-01-01T00:00:00-4:00"
    }
  ]
}
@Narnian12
Copy link
Author

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?

@Narnian12
Copy link
Author

I have figured out the issue, thanks!

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

No branches or pull requests

1 participant