/// <summary> /// Deserialize JSON into a FHIR MedicinalProductPharmaceutical#Characteristics /// </summary> public static void DeserializeJson(this MedicinalProductPharmaceutical.CharacteristicsComponent 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($"MedicinalProductPharmaceutical.CharacteristicsComponent >>> MedicinalProductPharmaceutical#Characteristics.{propertyName}, depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } reader.Read(); current.DeserializeJsonProperty(ref reader, options, propertyName); } } throw new JsonException($"MedicinalProductPharmaceutical.CharacteristicsComponent: invalid state! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); }
/// <summary> /// Deserialize JSON into a FHIR MedicinalProductPharmaceutical#Characteristics /// </summary> public static void DeserializeJsonProperty(this MedicinalProductPharmaceutical.CharacteristicsComponent current, ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName) { switch (propertyName) { case "code": current.Code = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.Code).DeserializeJson(ref reader, options); break; case "status": current.Status = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.Status).DeserializeJson(ref reader, options); break; // Complex: characteristics, Export: CharacteristicsComponent, Base: BackboneElement default: ((Hl7.Fhir.Model.BackboneElement)current).DeserializeJsonProperty(ref reader, options, propertyName); break; } }
/// <summary> /// Serialize a FHIR MedicinalProductPharmaceutical#Characteristics into JSON /// </summary> public static void SerializeJson(this MedicinalProductPharmaceutical.CharacteristicsComponent current, Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } // Component: MedicinalProductPharmaceutical#Characteristics, Export: CharacteristicsComponent, Base: BackboneElement (BackboneElement) ((Hl7.Fhir.Model.BackboneElement)current).SerializeJson(writer, options, false); writer.WritePropertyName("code"); current.Code.SerializeJson(writer, options); if (current.Status != null) { writer.WritePropertyName("status"); current.Status.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }