Exemple #1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "amount":
                Amount = new Fhir.R4.Models.SubstanceAmount();
                Amount.DeserializeJson(ref reader, options);
                break;

            case "isDefining":
                IsDefining = reader.GetBoolean();
                break;

            case "material":
                Material = new Fhir.R4.Models.CodeableConcept();
                Material.DeserializeJson(ref reader, options);
                break;

            case "type":
                Type = new Fhir.R4.Models.CodeableConcept();
                Type.DeserializeJson(ref reader, options);
                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "amount":
                Amount = new Fhir.R4.Models.SubstanceAmount();
                Amount.DeserializeJson(ref reader, options);
                break;

            case "degree":
                Degree = new Fhir.R4.Models.CodeableConcept();
                Degree.DeserializeJson(ref reader, options);
                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Exemple #3
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "amount":
                Amount = new Fhir.R4.Models.SubstanceAmount();
                Amount.DeserializeJson(ref reader, options);
                break;

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

                DegreeOfPolymerisation = new List <SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation objDegreeOfPolymerisation = new Fhir.R4.Models.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation();
                    objDegreeOfPolymerisation.DeserializeJson(ref reader, options);
                    DegreeOfPolymerisation.Add(objDegreeOfPolymerisation);

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

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

                break;

            case "orientationOfPolymerisation":
                OrientationOfPolymerisation = new Fhir.R4.Models.CodeableConcept();
                OrientationOfPolymerisation.DeserializeJson(ref reader, options);
                break;

            case "repeatUnit":
                RepeatUnit = reader.GetString();
                break;

            case "_repeatUnit":
                _RepeatUnit = new Fhir.R4.Models.Element();
                _RepeatUnit.DeserializeJson(ref reader, options);
                break;

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

                StructuralRepresentation = new List <SubstancePolymerRepeatRepeatUnitStructuralRepresentation>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.SubstancePolymerRepeatRepeatUnitStructuralRepresentation objStructuralRepresentation = new Fhir.R4.Models.SubstancePolymerRepeatRepeatUnitStructuralRepresentation();
                    objStructuralRepresentation.DeserializeJson(ref reader, options);
                    StructuralRepresentation.Add(objStructuralRepresentation);

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

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

                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }