Stream: dotnet
Topic: Implementation of Summary
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?
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.
Brian Postlethwaite (Sep 24 2018 at 20:49):
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);
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.
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