/// <summary>
        /// Deserialize JSON into a FHIR ObservationDefinition#QuantitativeDetails
        /// </summary>
        public static void DeserializeJson(this ObservationDefinition.QuantitativeDetailsComponent 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($"ObservationDefinition.QuantitativeDetailsComponent >>> ObservationDefinition#QuantitativeDetails.{propertyName}, depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}");
                    }
                    reader.Read();
                    current.DeserializeJsonProperty(ref reader, options, propertyName);
                }
            }

            throw new JsonException($"ObservationDefinition.QuantitativeDetailsComponent: invalid state! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}");
        }
        /// <summary>
        /// Deserialize JSON into a FHIR ObservationDefinition#QuantitativeDetails
        /// </summary>
        public static void DeserializeJsonProperty(this ObservationDefinition.QuantitativeDetailsComponent current, ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "customaryUnit":
                current.CustomaryUnit = new Hl7.Fhir.Model.CodeableConcept();
                ((Hl7.Fhir.Model.CodeableConcept)current.CustomaryUnit).DeserializeJson(ref reader, options);
                break;

            case "unit":
                current.Unit = new Hl7.Fhir.Model.CodeableConcept();
                ((Hl7.Fhir.Model.CodeableConcept)current.Unit).DeserializeJson(ref reader, options);
                break;

            case "conversionFactor":
                if (reader.TokenType == JsonTokenType.Null)
                {
                    current.ConversionFactorElement = new FhirDecimal();
                    reader.Skip();
                }
                else
                {
                    current.ConversionFactorElement = new FhirDecimal(reader.GetDecimal());
                }
                break;

            case "_conversionFactor":
                if (current.ConversionFactorElement == null)
                {
                    current.ConversionFactorElement = new FhirDecimal();
                }
                ((Hl7.Fhir.Model.Element)current.ConversionFactorElement).DeserializeJson(ref reader, options);
                break;

            case "decimalPrecision":
                if (reader.TokenType == JsonTokenType.Null)
                {
                    current.DecimalPrecisionElement = new Integer();
                    reader.Skip();
                }
                else
                {
                    current.DecimalPrecisionElement = new Integer(reader.GetInt32());
                }
                break;

            case "_decimalPrecision":
                if (current.DecimalPrecisionElement == null)
                {
                    current.DecimalPrecisionElement = new Integer();
                }
                ((Hl7.Fhir.Model.Element)current.DecimalPrecisionElement).DeserializeJson(ref reader, options);
                break;

            // Complex: quantitativeDetails, Export: QuantitativeDetailsComponent, Base: BackboneElement
            default:
                ((Hl7.Fhir.Model.BackboneElement)current).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
        /// <summary>
        /// Serialize a FHIR ObservationDefinition#QuantitativeDetails into JSON
        /// </summary>
        public static void SerializeJson(this ObservationDefinition.QuantitativeDetailsComponent current, Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }
            // Component: ObservationDefinition#QuantitativeDetails, Export: QuantitativeDetailsComponent, Base: BackboneElement (BackboneElement)
            ((Hl7.Fhir.Model.BackboneElement)current).SerializeJson(writer, options, false);

            if (current.CustomaryUnit != null)
            {
                writer.WritePropertyName("customaryUnit");
                current.CustomaryUnit.SerializeJson(writer, options);
            }

            if (current.Unit != null)
            {
                writer.WritePropertyName("unit");
                current.Unit.SerializeJson(writer, options);
            }

            if (current.ConversionFactorElement != null)
            {
                if (current.ConversionFactorElement.Value != null)
                {
                    writer.WriteNumber("conversionFactor", (decimal)current.ConversionFactorElement.Value);
                }
                if (current.ConversionFactorElement.HasExtensions() || (!string.IsNullOrEmpty(current.ConversionFactorElement.ElementId)))
                {
                    JsonStreamUtilities.SerializeExtensionList(writer, options, "_conversionFactor", false, current.ConversionFactorElement.Extension, current.ConversionFactorElement.ElementId);
                }
            }

            if (current.DecimalPrecisionElement != null)
            {
                if (current.DecimalPrecisionElement.Value != null)
                {
                    writer.WriteNumber("decimalPrecision", (int)current.DecimalPrecisionElement.Value);
                }
                if (current.DecimalPrecisionElement.HasExtensions() || (!string.IsNullOrEmpty(current.DecimalPrecisionElement.ElementId)))
                {
                    JsonStreamUtilities.SerializeExtensionList(writer, options, "_decimalPrecision", false, current.DecimalPrecisionElement.Extension, current.DecimalPrecisionElement.ElementId);
                }
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }