FHIR Chat · FHIR .NET API Deserialize Profiles · implementers

Stream: implementers

Topic: FHIR .NET API Deserialize Profiles


view this post on Zulip Ashwani Mehlem (Jul 14 2020 at 09:39):

Hi,

I am trying to figure out what's the best way to deserialize and validate custom profiles on certain types using the FHIR.NET API. I was tasked with writing a JSON-Deserializer for the types defined on https://simplifier.net/evo/evoprkhbabundle and https://simplifier.net/evo/evoprkhbacomposition. It would be great to get some info on how to proceed in this case, especially if it is possible to define custom C#-Classes für the types and to deserialize to these directly. Or is the preferred way to deserialize to a predefined type like Composition and Bundle? Or using the low-level types?
Also, it would be great to have some info about how to define the changes on the profiles mentioned above in the C#-Class, if that is supported.

Kind regards,
Ashwani Mehlem

view this post on Zulip Grahame Grieve (Jul 14 2020 at 10:53):

in general, you can't provide custom types - you get a bundle, say, full of resources of various types, the conform to multiple profiles. Your deserialiser doesn't know which profile to read it as. It's better to think around generating facades to access the underlying resources for building and reading

view this post on Zulip Ashwani Mehlem (Jul 14 2020 at 12:05):

Ah okay, thank you for explaining. I will try this approach.


Last updated: Apr 12 2022 at 19:14 UTC