/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } ((fhirCsR4.Models.BackboneElement) this).SerializeJson(writer, options, false); if (AdditiveCodeableConcept != null) { writer.WritePropertyName("additiveCodeableConcept"); AdditiveCodeableConcept.SerializeJson(writer, options); } if (AdditiveReference != null) { writer.WritePropertyName("additiveReference"); AdditiveReference.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } ((fhirCsR4.Models.BackboneElement) this).SerializeJson(writer, options, false); if ((Identifier != null) && (Identifier.Count != 0)) { writer.WritePropertyName("identifier"); writer.WriteStartArray(); foreach (Identifier valIdentifier in Identifier) { valIdentifier.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Description)) { writer.WriteString("description", (string)Description !); } if (_Description != null) { writer.WritePropertyName("_description"); _Description.SerializeJson(writer, options); } if (Type != null) { writer.WritePropertyName("type"); Type.SerializeJson(writer, options); } if (Capacity != null) { writer.WritePropertyName("capacity"); Capacity.SerializeJson(writer, options); } if (SpecimenQuantity != null) { writer.WritePropertyName("specimenQuantity"); SpecimenQuantity.SerializeJson(writer, options); } if (AdditiveCodeableConcept != null) { writer.WritePropertyName("additiveCodeableConcept"); AdditiveCodeableConcept.SerializeJson(writer, options); } if (AdditiveReference != null) { writer.WritePropertyName("additiveReference"); AdditiveReference.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }