Exemple #1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "compartment":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Compartment = new List <GraphDefinitionLinkTargetCompartment>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.GraphDefinitionLinkTargetCompartment objCompartment = new Fhir.R4.Models.GraphDefinitionLinkTargetCompartment();
                    objCompartment.DeserializeJson(ref reader, options);
                    Compartment.Add(objCompartment);

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

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

                break;

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

                Link = new List <GraphDefinitionLink>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.GraphDefinitionLink objLink = new Fhir.R4.Models.GraphDefinitionLink();
                    objLink.DeserializeJson(ref reader, options);
                    Link.Add(objLink);

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

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

                break;

            case "params":
                Params = reader.GetString();
                break;

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

            case "profile":
                Profile = reader.GetString();
                break;

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

            case "type":
                Type = reader.GetString();
                break;

            case "_type":
                _Type = new Fhir.R4.Models.Element();
                _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 "contact":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Contact = new List <ContactDetail>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactDetail objContact = new Fhir.R4.Models.ContactDetail();
                    objContact.DeserializeJson(ref reader, options);
                    Contact.Add(objContact);

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

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

                break;

            case "date":
                Date = reader.GetString();
                break;

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

            case "description":
                Description = reader.GetString();
                break;

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

            case "experimental":
                Experimental = reader.GetBoolean();
                break;

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

                Jurisdiction = new List <CodeableConcept>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.CodeableConcept objJurisdiction = new Fhir.R4.Models.CodeableConcept();
                    objJurisdiction.DeserializeJson(ref reader, options);
                    Jurisdiction.Add(objJurisdiction);

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

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

                break;

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

                Link = new List <GraphDefinitionLink>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.GraphDefinitionLink objLink = new Fhir.R4.Models.GraphDefinitionLink();
                    objLink.DeserializeJson(ref reader, options);
                    Link.Add(objLink);

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

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

                break;

            case "name":
                Name = reader.GetString();
                break;

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

            case "profile":
                Profile = reader.GetString();
                break;

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

            case "publisher":
                Publisher = reader.GetString();
                break;

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

            case "purpose":
                Purpose = reader.GetString();
                break;

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

            case "start":
                Start = reader.GetString();
                break;

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

            case "status":
                Status = reader.GetString();
                break;

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

            case "url":
                Url = reader.GetString();
                break;

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

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

                UseContext = new List <UsageContext>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.UsageContext objUseContext = new Fhir.R4.Models.UsageContext();
                    objUseContext.DeserializeJson(ref reader, options);
                    UseContext.Add(objUseContext);

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

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

                break;

            case "version":
                Version = reader.GetString();
                break;

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

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