Exemplo n.º 1
0
        /// <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 (!string.IsNullOrEmpty(Text))
            {
                writer.WriteString("text", (string)Text !);
            }

            if (_Text != null)
            {
                writer.WritePropertyName("_text");
                _Text.SerializeJson(writer, options);
            }

            if (Site != null)
            {
                writer.WritePropertyName("site");
                Site.SerializeJson(writer, options);
            }

            if (Route != null)
            {
                writer.WritePropertyName("route");
                Route.SerializeJson(writer, options);
            }

            if (Method != null)
            {
                writer.WritePropertyName("method");
                Method.SerializeJson(writer, options);
            }

            if (Dose != null)
            {
                writer.WritePropertyName("dose");
                Dose.SerializeJson(writer, options);
            }

            if (RateRatio != null)
            {
                writer.WritePropertyName("rateRatio");
                RateRatio.SerializeJson(writer, options);
            }

            if (RateQuantity != null)
            {
                writer.WritePropertyName("rateQuantity");
                RateQuantity.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.Element) this).SerializeJson(writer, options, false);

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (DoseRange != null)
            {
                writer.WritePropertyName("doseRange");
                DoseRange.SerializeJson(writer, options);
            }

            if (DoseQuantity != null)
            {
                writer.WritePropertyName("doseQuantity");
                DoseQuantity.SerializeJson(writer, options);
            }

            if (RateRatio != null)
            {
                writer.WritePropertyName("rateRatio");
                RateRatio.SerializeJson(writer, options);
            }

            if (RateRange != null)
            {
                writer.WritePropertyName("rateRange");
                RateRange.SerializeJson(writer, options);
            }

            if (RateQuantity != null)
            {
                writer.WritePropertyName("rateQuantity");
                RateQuantity.SerializeJson(writer, options);
            }

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