/// <summary> /// Deserialize JSON into a FHIR Invoice#Participant /// </summary> public static void DeserializeJson(this Invoice.ParticipantComponent current, ref Utf8JsonReader reader, JsonSerializerOptions options) { string propertyName; while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) { return; } if (reader.TokenType == JsonTokenType.PropertyName) { propertyName = reader.GetString(); if (Hl7.Fhir.Serialization.FhirSerializerOptions.Debug) { Console.WriteLine($"Invoice.ParticipantComponent >>> Invoice#Participant.{propertyName}, depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } reader.Read(); current.DeserializeJsonProperty(ref reader, options, propertyName); } } throw new JsonException($"Invoice.ParticipantComponent: invalid state! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); }
/// <summary> /// Deserialize JSON into a FHIR Invoice#Participant /// </summary> public static void DeserializeJsonProperty(this Invoice.ParticipantComponent current, ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName) { switch (propertyName) { case "role": current.Role = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.Role).DeserializeJson(ref reader, options); break; case "actor": current.Actor = new Hl7.Fhir.Model.ResourceReference(); ((Hl7.Fhir.Model.ResourceReference)current.Actor).DeserializeJson(ref reader, options); break; // Complex: participant, Export: ParticipantComponent, Base: BackboneElement default: ((Hl7.Fhir.Model.BackboneElement)current).DeserializeJsonProperty(ref reader, options, propertyName); break; } }
/// <summary> /// Serialize a FHIR Invoice#Participant into JSON /// </summary> public static void SerializeJson(this Invoice.ParticipantComponent current, Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } // Component: Invoice#Participant, Export: ParticipantComponent, Base: BackboneElement (BackboneElement) ((Hl7.Fhir.Model.BackboneElement)current).SerializeJson(writer, options, false); if (current.Role != null) { writer.WritePropertyName("role"); current.Role.SerializeJson(writer, options); } writer.WritePropertyName("actor"); current.Actor.SerializeJson(writer, options); if (includeStartObject) { writer.WriteEndObject(); } }