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


            ((fhirCsR4.Models.DomainResource) 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 ((InstantiatesCanonical != null) && (InstantiatesCanonical.Count != 0))
            {
                writer.WritePropertyName("instantiatesCanonical");
                writer.WriteStartArray();

                foreach (string valInstantiatesCanonical in InstantiatesCanonical)
                {
                    writer.WriteStringValue(valInstantiatesCanonical);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_InstantiatesCanonical in _InstantiatesCanonical)
                {
                    val_InstantiatesCanonical.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (string valInstantiatesUri in InstantiatesUri)
                {
                    writer.WriteStringValue(valInstantiatesUri);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_InstantiatesUri in _InstantiatesUri)
                {
                    val_InstantiatesUri.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

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

            if (!string.IsNullOrEmpty(Date))
            {
                writer.WriteString("date", (string)Date !);
            }

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

            if (!string.IsNullOrEmpty(Name))
            {
                writer.WriteString("name", (string)Name !);
            }

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

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

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

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

            if (!string.IsNullOrEmpty(BornDate))
            {
                writer.WriteString("bornDate", (string)BornDate !);
            }

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

            if (!string.IsNullOrEmpty(BornString))
            {
                writer.WriteString("bornString", (string)BornString !);
            }

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

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

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

            if (!string.IsNullOrEmpty(AgeString))
            {
                writer.WriteString("ageString", (string)AgeString !);
            }

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

            if (EstimatedAge != null)
            {
                writer.WriteBoolean("estimatedAge", (bool)EstimatedAge !);
            }

            if (DeceasedBoolean != null)
            {
                writer.WriteBoolean("deceasedBoolean", (bool)DeceasedBoolean !);
            }

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

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

            if (!string.IsNullOrEmpty(DeceasedDate))
            {
                writer.WriteString("deceasedDate", (string)DeceasedDate !);
            }

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

            if (!string.IsNullOrEmpty(DeceasedString))
            {
                writer.WriteString("deceasedString", (string)DeceasedString !);
            }

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

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

                foreach (CodeableConcept valReasonCode in ReasonCode)
                {
                    valReasonCode.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valReasonReference in ReasonReference)
                {
                    valReasonReference.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

                writer.WriteEndArray();
            }

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

                foreach (FamilyMemberHistoryCondition valCondition in Condition)
                {
                    valCondition.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            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 ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (!string.IsNullOrEmpty(Date))
            {
                writer.WriteString("date", (string)Date !);
            }

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

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

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

                foreach (ImmunizationRecommendationRecommendation valRecommendation in Recommendation)
                {
                    valRecommendation.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();
            }
            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((fhirCsR4.Models.DomainResource) 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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

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

                foreach (string valPurpose in Purpose)
                {
                    writer.WriteStringValue(valPurpose);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_Purpose in _Purpose)
                {
                    val_Purpose.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (!string.IsNullOrEmpty(ServicedDate))
            {
                writer.WriteString("servicedDate", (string)ServicedDate !);
            }

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

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

            if (!string.IsNullOrEmpty(Created))
            {
                writer.WriteString("created", (string)Created !);
            }

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

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

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

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

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

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

                foreach (CoverageEligibilityRequestSupportingInfo valSupportingInfo in SupportingInfo)
                {
                    valSupportingInfo.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (CoverageEligibilityRequestInsurance valInsurance in Insurance)
                {
                    valInsurance.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (CoverageEligibilityRequestItem valItem in Item)
                {
                    valItem.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #4
0
        /// <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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

            if (!string.IsNullOrEmpty(Date))
            {
                writer.WriteString("date", (string)Date !);
            }

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

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

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

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

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

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

                foreach (CodeableConcept valDoseStatusReason in DoseStatusReason)
                {
                    valDoseStatusReason.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 (!string.IsNullOrEmpty(Series))
            {
                writer.WriteString("series", (string)Series !);
            }

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

            if (DoseNumberPositiveInt != null)
            {
                writer.WriteNumber("doseNumberPositiveInt", (uint)DoseNumberPositiveInt !);
            }

            if (!string.IsNullOrEmpty(DoseNumberString))
            {
                writer.WriteString("doseNumberString", (string)DoseNumberString !);
            }

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

            if (SeriesDosesPositiveInt != null)
            {
                writer.WriteNumber("seriesDosesPositiveInt", (uint)SeriesDosesPositiveInt !);
            }

            if (!string.IsNullOrEmpty(SeriesDosesString))
            {
                writer.WriteString("seriesDosesString", (string)SeriesDosesString !);
            }

            if (_SeriesDosesString != null)
            {
                writer.WritePropertyName("_seriesDosesString");
                _SeriesDosesString.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 ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

            if (!string.IsNullOrEmpty(Type))
            {
                writer.WriteString("type", (string)Type !);
            }

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

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

                foreach (string valCategory in Category)
                {
                    writer.WriteStringValue(valCategory);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_Category in _Category)
                {
                    val_Category.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Criticality))
            {
                writer.WriteString("criticality", (string)Criticality !);
            }

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

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

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

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

            if (!string.IsNullOrEmpty(OnsetDateTime))
            {
                writer.WriteString("onsetDateTime", (string)OnsetDateTime !);
            }

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

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

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

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

            if (!string.IsNullOrEmpty(OnsetString))
            {
                writer.WriteString("onsetString", (string)OnsetString !);
            }

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

            if (!string.IsNullOrEmpty(RecordedDate))
            {
                writer.WriteString("recordedDate", (string)RecordedDate !);
            }

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

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

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

            if (!string.IsNullOrEmpty(LastOccurrence))
            {
                writer.WriteString("lastOccurrence", (string)LastOccurrence !);
            }

            if (_LastOccurrence != null)
            {
                writer.WritePropertyName("_lastOccurrence");
                _LastOccurrence.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 ((Reaction != null) && (Reaction.Count != 0))
            {
                writer.WritePropertyName("reaction");
                writer.WriteStartArray();

                foreach (AllergyIntoleranceReaction valReaction in Reaction)
                {
                    valReaction.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #6
0
        /// <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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

                foreach (string valPurpose in Purpose)
                {
                    writer.WriteStringValue(valPurpose);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_Purpose in _Purpose)
                {
                    val_Purpose.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (!string.IsNullOrEmpty(ServicedDate))
            {
                writer.WriteString("servicedDate", (string)ServicedDate !);
            }

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

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

            if (!string.IsNullOrEmpty(Created))
            {
                writer.WriteString("created", (string)Created !);
            }

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

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

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

            if (!string.IsNullOrEmpty(Outcome))
            {
                writer.WriteString("outcome", (string)Outcome !);
            }

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

            if (!string.IsNullOrEmpty(Disposition))
            {
                writer.WriteString("disposition", (string)Disposition !);
            }

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

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

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

                foreach (CoverageEligibilityResponseInsurance valInsurance in Insurance)
                {
                    valInsurance.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(PreAuthRef))
            {
                writer.WriteString("preAuthRef", (string)PreAuthRef !);
            }

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

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

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

                foreach (CoverageEligibilityResponseError valError in Error)
                {
                    valError.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #7
0
        /// <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 ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valBasedOn in BasedOn)
                {
                    valBasedOn.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valPartOf in PartOf)
                {
                    valPartOf.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

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

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

            if (!string.IsNullOrEmpty(OccurrenceDateTime))
            {
                writer.WriteString("occurrenceDateTime", (string)OccurrenceDateTime !);
            }

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

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

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

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

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

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

                foreach (Reference valReceiver in Receiver)
                {
                    valReceiver.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

            if (!string.IsNullOrEmpty(Created))
            {
                writer.WriteString("created", (string)Created !);
            }

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

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

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

            if (!string.IsNullOrEmpty(DateWritten))
            {
                writer.WriteString("dateWritten", (string)DateWritten !);
            }

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

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

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

                foreach (VisionPrescriptionLensSpecification valLensSpecification in LensSpecification)
                {
                    valLensSpecification.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

            if (!string.IsNullOrEmpty(Severity))
            {
                writer.WriteString("severity", (string)Severity !);
            }

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

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

            if (!string.IsNullOrEmpty(IdentifiedDateTime))
            {
                writer.WriteString("identifiedDateTime", (string)IdentifiedDateTime !);
            }

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

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

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

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

                foreach (Reference valImplicated in Implicated)
                {
                    valImplicated.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (DetectedIssueEvidence valEvidence in Evidence)
                {
                    valEvidence.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Detail))
            {
                writer.WriteString("detail", (string)Detail !);
            }

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

            if (!string.IsNullOrEmpty(Reference))
            {
                writer.WriteString("reference", (string)Reference !);
            }

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

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

                foreach (DetectedIssueMitigation valMitigation in Mitigation)
                {
                    valMitigation.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #10
0
        /// <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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

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

                foreach (CodeableConcept valCategory in Category)
                {
                    valCategory.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (!string.IsNullOrEmpty(DateTime))
            {
                writer.WriteString("dateTime", (string)DateTime !);
            }

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

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

                foreach (Reference valPerformer in Performer)
                {
                    valPerformer.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valOrganization in Organization)
                {
                    valOrganization.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

                foreach (ConsentPolicy valPolicy in Policy)
                {
                    valPolicy.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

                foreach (ConsentVerification valVerification in Verification)
                {
                    valVerification.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #11
0
        /// <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 ((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(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

                foreach (EpisodeOfCareStatusHistory valStatusHistory in StatusHistory)
                {
                    valStatusHistory.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (CodeableConcept valType in Type)
                {
                    valType.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (EpisodeOfCareDiagnosis valDiagnosis in Diagnosis)
                {
                    valDiagnosis.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

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

                foreach (Reference valReferralRequest in ReferralRequest)
                {
                    valReferralRequest.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

                foreach (Reference valTeam in Team)
                {
                    valTeam.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valAccount in Account)
                {
                    valAccount.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Beispiel #12
0
        /// <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 ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Active != null)
            {
                writer.WriteBoolean("active", (bool)Active !);
            }

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

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

                foreach (CodeableConcept valRelationship in Relationship)
                {
                    valRelationship.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (HumanName valName in Name)
                {
                    valName.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (ContactPoint valTelecom in Telecom)
                {
                    valTelecom.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Gender))
            {
                writer.WriteString("gender", (string)Gender !);
            }

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

            if (!string.IsNullOrEmpty(BirthDate))
            {
                writer.WriteString("birthDate", (string)BirthDate !);
            }

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

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

                foreach (Address valAddress in Address)
                {
                    valAddress.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Attachment valPhoto in Photo)
                {
                    valPhoto.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

                foreach (RelatedPersonCommunication valCommunication in Communication)
                {
                    valCommunication.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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