FHIR Chat · Implementation of Summary · dotnet

Stream: dotnet

Topic: Implementation of Summary


view this post on Zulip Yunwei Wang (Sep 24 2018 at 19:27):

Moving this discussion from implementer stream. I am trying to implement _summary search so I need to know if an element is a summary element. For example, if I have a Patient resource instance, how do I know which elements are summary?

view this post on Zulip Brian Postlethwaite (Sep 24 2018 at 20:46):

Each property is marked up with an attribute that indicates this when using the poco classes. Otherwise you need to look at the structure definition.

view this post on Zulip Brian Postlethwaite (Sep 24 2018 at 20:49):

https://github.com/ewoutkramer/fhir-net-api/blob/ce6846698654fef11c60a059547f8f9aeee6e947/src/Hl7.Fhir.Core/Model/Generated/Patient.cs#L699

view this post on Zulip Angus Millar (Sep 25 2018 at 03:33):

Is what your looking for a simple as passing the required 'SummaryType' enum when seralizing the resources?
Hl7.Fhir.Serialization.FhirXmlSerializer
public void Serialize(Base instance, XmlWriter writer, SummaryType summary = SummaryType.False);

view this post on Zulip Ewout Kramer (Sep 25 2018 at 09:02):

Both answers are correct ;-) The property that @Brian Postlethwaite mentions is used to direct the serializer, so it can handle the SummaryType parameter as @Angus Millar mentioned.

view this post on Zulip Yunwei Wang (Sep 25 2018 at 13:10):

the serializer method is awesome! Thank you @Angus Millar @Ewout Kramer @Brian Postlethwaite


Last updated: Apr 12 2022 at 19:14 UTC