Beispiel #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(Description))
            {
                writer.WriteString("description", (string)Description !);
            }

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

            if (Temperature != null)
            {
                writer.WriteNumber("temperature", (decimal)Temperature !);
            }

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

            if (!string.IsNullOrEmpty(Scale))
            {
                writer.WriteString("scale", (string)Scale !);
            }

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

            if (Duration != null)
            {
                writer.WritePropertyName("duration");
                Duration.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();
            }
            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if ((Subject != null) && (Subject.Count != 0))
            {
                writer.WritePropertyName("subject");
                writer.WriteStartArray();

                foreach (Reference valSubject in Subject)
                {
                    valSubject.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

            if ((Comorbidity != null) && (Comorbidity.Count != 0))
            {
                writer.WritePropertyName("comorbidity");
                writer.WriteStartArray();

                foreach (CodeableConcept valComorbidity in Comorbidity)
                {
                    valComorbidity.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

            if ((OtherTherapy != null) && (OtherTherapy.Count != 0))
            {
                writer.WritePropertyName("otherTherapy");
                writer.WriteStartArray();

                foreach (MedicinalProductIndicationOtherTherapy valOtherTherapy in OtherTherapy)
                {
                    valOtherTherapy.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((UndesirableEffect != null) && (UndesirableEffect.Count != 0))
            {
                writer.WritePropertyName("undesirableEffect");
                writer.WriteStartArray();

                foreach (Reference valUndesirableEffect in UndesirableEffect)
                {
                    valUndesirableEffect.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Population != null) && (Population.Count != 0))
            {
                writer.WritePropertyName("population");
                writer.WriteStartArray();

                foreach (Population valPopulation in Population)
                {
                    valPopulation.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #3
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 (Collector != null)
            {
                writer.WritePropertyName("collector");
                Collector.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(CollectedDateTime))
            {
                writer.WriteString("collectedDateTime", (string)CollectedDateTime !);
            }

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

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

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

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

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

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

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

            if (FastingStatusDuration != null)
            {
                writer.WritePropertyName("fastingStatusDuration");
                FastingStatusDuration.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 (Product != null)
            {
                writer.WritePropertyName("product");
                Product.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Eye))
            {
                writer.WriteString("eye", (string)Eye !);
            }

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

            if (Sphere != null)
            {
                writer.WriteNumber("sphere", (decimal)Sphere !);
            }

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

            if (Cylinder != null)
            {
                writer.WriteNumber("cylinder", (decimal)Cylinder !);
            }

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

            if (Axis != null)
            {
                writer.WriteNumber("axis", (int)Axis !);
            }

            if ((Prism != null) && (Prism.Count != 0))
            {
                writer.WritePropertyName("prism");
                writer.WriteStartArray();

                foreach (VisionPrescriptionLensSpecificationPrism valPrism in Prism)
                {
                    valPrism.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Add != null)
            {
                writer.WriteNumber("add", (decimal)Add !);
            }

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

            if (Power != null)
            {
                writer.WriteNumber("power", (decimal)Power !);
            }

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

            if (BackCurve != null)
            {
                writer.WriteNumber("backCurve", (decimal)BackCurve !);
            }

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

            if (Diameter != null)
            {
                writer.WriteNumber("diameter", (decimal)Diameter !);
            }

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

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

            if (!string.IsNullOrEmpty(Color))
            {
                writer.WriteString("color", (string)Color !);
            }

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

            if (!string.IsNullOrEmpty(Brand))
            {
                writer.WriteString("brand", (string)Brand !);
            }

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

            if ((Note != null) && (Note.Count != 0))
            {
                writer.WritePropertyName("note");
                writer.WriteStartArray();

                foreach (Annotation valNote in Note)
                {
                    valNote.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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