Пример #1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "classification":
                Classification = new fhirCsR4.Models.CodeableConcept();
                Classification.DeserializeJson(ref reader, options);
                break;

            case "frequencyOfOccurrence":
                FrequencyOfOccurrence = new fhirCsR4.Models.CodeableConcept();
                FrequencyOfOccurrence.DeserializeJson(ref reader, options);
                break;

            case "population":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Population = new List <Population>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Population objPopulation = new fhirCsR4.Models.Population();
                    objPopulation.DeserializeJson(ref reader, options);
                    Population.Add(objPopulation);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Population.Count == 0)
                {
                    Population = null;
                }

                break;

            case "subject":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Subject = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Reference objSubject = new fhirCsR4.Models.Reference();
                    objSubject.DeserializeJson(ref reader, options);
                    Subject.Add(objSubject);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Subject.Count == 0)
                {
                    Subject = null;
                }

                break;

            case "symptomConditionEffect":
                SymptomConditionEffect = new fhirCsR4.Models.CodeableConcept();
                SymptomConditionEffect.DeserializeJson(ref reader, options);
                break;

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "comorbidity":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Comorbidity = new List <CodeableConcept>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.CodeableConcept objComorbidity = new fhirCsR4.Models.CodeableConcept();
                    objComorbidity.DeserializeJson(ref reader, options);
                    Comorbidity.Add(objComorbidity);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Comorbidity.Count == 0)
                {
                    Comorbidity = null;
                }

                break;

            case "diseaseStatus":
                DiseaseStatus = new fhirCsR4.Models.CodeableConcept();
                DiseaseStatus.DeserializeJson(ref reader, options);
                break;

            case "diseaseSymptomProcedure":
                DiseaseSymptomProcedure = new fhirCsR4.Models.CodeableConcept();
                DiseaseSymptomProcedure.DeserializeJson(ref reader, options);
                break;

            case "duration":
                Duration = new fhirCsR4.Models.Quantity();
                Duration.DeserializeJson(ref reader, options);
                break;

            case "intendedEffect":
                IntendedEffect = new fhirCsR4.Models.CodeableConcept();
                IntendedEffect.DeserializeJson(ref reader, options);
                break;

            case "otherTherapy":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                OtherTherapy = new List <MedicinalProductIndicationOtherTherapy>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.MedicinalProductIndicationOtherTherapy objOtherTherapy = new fhirCsR4.Models.MedicinalProductIndicationOtherTherapy();
                    objOtherTherapy.DeserializeJson(ref reader, options);
                    OtherTherapy.Add(objOtherTherapy);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (OtherTherapy.Count == 0)
                {
                    OtherTherapy = null;
                }

                break;

            case "population":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Population = new List <Population>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Population objPopulation = new fhirCsR4.Models.Population();
                    objPopulation.DeserializeJson(ref reader, options);
                    Population.Add(objPopulation);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Population.Count == 0)
                {
                    Population = null;
                }

                break;

            case "subject":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Subject = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Reference objSubject = new fhirCsR4.Models.Reference();
                    objSubject.DeserializeJson(ref reader, options);
                    Subject.Add(objSubject);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Subject.Count == 0)
                {
                    Subject = null;
                }

                break;

            case "undesirableEffect":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                UndesirableEffect = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Reference objUndesirableEffect = new fhirCsR4.Models.Reference();
                    objUndesirableEffect.DeserializeJson(ref reader, options);
                    UndesirableEffect.Add(objUndesirableEffect);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (UndesirableEffect.Count == 0)
                {
                    UndesirableEffect = null;
                }

                break;

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }