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

            case "name":
                Name = new Fhir.R4.Models.HumanName();
                Name.DeserializeJson(ref reader, options);
                break;

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

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

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

            case "endpoint":
                Endpoint = reader.GetString();
                break;

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

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

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

            case "software":
                Software = reader.GetString();
                break;

            case "_software":
                _Software = new Fhir.R4.Models.Element();
                _Software.DeserializeJson(ref reader, options);
                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.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "name":
                Name = reader.GetString();
                break;

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

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

            case "availabilityExceptions":
                AvailabilityExceptions = reader.GetString();
                break;

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

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

                AvailableTime = new List <PractitionerRoleAvailableTime>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.PractitionerRoleAvailableTime objAvailableTime = new Fhir.R4.Models.PractitionerRoleAvailableTime();
                    objAvailableTime.DeserializeJson(ref reader, options);
                    AvailableTime.Add(objAvailableTime);

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

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

                break;

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

                Code = new List <CodeableConcept>();

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

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

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

                break;

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

                Endpoint = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objEndpoint = new Fhir.R4.Models.Reference();
                    objEndpoint.DeserializeJson(ref reader, options);
                    Endpoint.Add(objEndpoint);

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

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

                break;

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

                HealthcareService = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objHealthcareService = new Fhir.R4.Models.Reference();
                    objHealthcareService.DeserializeJson(ref reader, options);
                    HealthcareService.Add(objHealthcareService);

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

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

                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Location = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objLocation = new Fhir.R4.Models.Reference();
                    objLocation.DeserializeJson(ref reader, options);
                    Location.Add(objLocation);

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

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

                break;

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

                NotAvailable = new List <PractitionerRoleNotAvailable>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.PractitionerRoleNotAvailable objNotAvailable = new Fhir.R4.Models.PractitionerRoleNotAvailable();
                    objNotAvailable.DeserializeJson(ref reader, options);
                    NotAvailable.Add(objNotAvailable);

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

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

                break;

            case "organization":
                Organization = new Fhir.R4.Models.Reference();
                Organization.DeserializeJson(ref reader, options);
                break;

            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

            case "practitioner":
                Practitioner = new Fhir.R4.Models.Reference();
                Practitioner.DeserializeJson(ref reader, options);
                break;

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

                Specialty = new List <CodeableConcept>();

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

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

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

                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "name":
                Name = reader.GetString();
                break;

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

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

                Part = new List <ParametersParameter>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ParametersParameter objPart = new Fhir.R4.Models.ParametersParameter();
                    objPart.DeserializeJson(ref reader, options);
                    Part.Add(objPart);

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

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

                break;

            case "resource":
                Resource = JsonSerializer.Deserialize <Fhir.R4.Models.Resource>(ref reader, options);
                break;

            case "valueBase64Binary":
                ValueBase64Binary = reader.GetString();
                break;

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

            case "valueBoolean":
                ValueBoolean = reader.GetBoolean();
                break;

            case "valueCanonical":
                ValueCanonical = reader.GetString();
                break;

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

            case "valueCode":
                ValueCode = reader.GetString();
                break;

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

            case "valueDate":
                ValueDate = reader.GetString();
                break;

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

            case "valueDateTime":
                ValueDateTime = reader.GetString();
                break;

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

            case "valueDecimal":
                ValueDecimal = reader.GetDecimal();
                break;

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

            case "valueId":
                ValueId = reader.GetString();
                break;

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

            case "valueInstant":
                ValueInstant = reader.GetString();
                break;

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

            case "valueInteger":
                ValueInteger = reader.GetInt32();
                break;

            case "valueMarkdown":
                ValueMarkdown = reader.GetString();
                break;

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

            case "valueOid":
                ValueOid = reader.GetString();
                break;

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

            case "valuePositiveInt":
                ValuePositiveInt = reader.GetUInt32();
                break;

            case "valueString":
                ValueString = reader.GetString();
                break;

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

            case "valueTime":
                ValueTime = reader.GetString();
                break;

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

            case "valueUnsignedInt":
                ValueUnsignedInt = reader.GetUInt32();
                break;

            case "valueUri":
                ValueUri = reader.GetString();
                break;

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

            case "valueUrl":
                ValueUrl = reader.GetString();
                break;

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

            case "valueUuid":
                ValueUuid = reader.GetGuid();
                break;

            case "valueAddress":
                ValueAddress = new Fhir.R4.Models.Address();
                ValueAddress.DeserializeJson(ref reader, options);
                break;

            case "valueAge":
                ValueAge = new Fhir.R4.Models.Age();
                ValueAge.DeserializeJson(ref reader, options);
                break;

            case "valueAnnotation":
                ValueAnnotation = new Fhir.R4.Models.Annotation();
                ValueAnnotation.DeserializeJson(ref reader, options);
                break;

            case "valueAttachment":
                ValueAttachment = new Fhir.R4.Models.Attachment();
                ValueAttachment.DeserializeJson(ref reader, options);
                break;

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

            case "valueCoding":
                ValueCoding = new Fhir.R4.Models.Coding();
                ValueCoding.DeserializeJson(ref reader, options);
                break;

            case "valueContactPoint":
                ValueContactPoint = new Fhir.R4.Models.ContactPoint();
                ValueContactPoint.DeserializeJson(ref reader, options);
                break;

            case "valueCount":
                ValueCount = new Fhir.R4.Models.Count();
                ValueCount.DeserializeJson(ref reader, options);
                break;

            case "valueDistance":
                ValueDistance = new Fhir.R4.Models.Distance();
                ValueDistance.DeserializeJson(ref reader, options);
                break;

            case "valueDuration":
                ValueDuration = new Fhir.R4.Models.Duration();
                ValueDuration.DeserializeJson(ref reader, options);
                break;

            case "valueHumanName":
                ValueHumanName = new Fhir.R4.Models.HumanName();
                ValueHumanName.DeserializeJson(ref reader, options);
                break;

            case "valueIdentifier":
                ValueIdentifier = new Fhir.R4.Models.Identifier();
                ValueIdentifier.DeserializeJson(ref reader, options);
                break;

            case "valueMoney":
                ValueMoney = new Fhir.R4.Models.Money();
                ValueMoney.DeserializeJson(ref reader, options);
                break;

            case "valuePeriod":
                ValuePeriod = new Fhir.R4.Models.Period();
                ValuePeriod.DeserializeJson(ref reader, options);
                break;

            case "valueQuantity":
                ValueQuantity = new Fhir.R4.Models.Quantity();
                ValueQuantity.DeserializeJson(ref reader, options);
                break;

            case "valueRange":
                ValueRange = new Fhir.R4.Models.Range();
                ValueRange.DeserializeJson(ref reader, options);
                break;

            case "valueRatio":
                ValueRatio = new Fhir.R4.Models.Ratio();
                ValueRatio.DeserializeJson(ref reader, options);
                break;

            case "valueReference":
                ValueReference = new Fhir.R4.Models.Reference();
                ValueReference.DeserializeJson(ref reader, options);
                break;

            case "valueSampledData":
                ValueSampledData = new Fhir.R4.Models.SampledData();
                ValueSampledData.DeserializeJson(ref reader, options);
                break;

            case "valueSignature":
                ValueSignature = new Fhir.R4.Models.Signature();
                ValueSignature.DeserializeJson(ref reader, options);
                break;

            case "valueTiming":
                ValueTiming = new Fhir.R4.Models.Timing();
                ValueTiming.DeserializeJson(ref reader, options);
                break;

            case "valueContactDetail":
                ValueContactDetail = new Fhir.R4.Models.ContactDetail();
                ValueContactDetail.DeserializeJson(ref reader, options);
                break;

            case "valueContributor":
                ValueContributor = new Fhir.R4.Models.Contributor();
                ValueContributor.DeserializeJson(ref reader, options);
                break;

            case "valueDataRequirement":
                ValueDataRequirement = new Fhir.R4.Models.DataRequirement();
                ValueDataRequirement.DeserializeJson(ref reader, options);
                break;

            case "valueExpression":
                ValueExpression = new Fhir.R4.Models.Expression();
                ValueExpression.DeserializeJson(ref reader, options);
                break;

            case "valueParameterDefinition":
                ValueParameterDefinition = new Fhir.R4.Models.ParameterDefinition();
                ValueParameterDefinition.DeserializeJson(ref reader, options);
                break;

            case "valueRelatedArtifact":
                ValueRelatedArtifact = new Fhir.R4.Models.RelatedArtifact();
                ValueRelatedArtifact.DeserializeJson(ref reader, options);
                break;

            case "valueTriggerDefinition":
                ValueTriggerDefinition = new Fhir.R4.Models.TriggerDefinition();
                ValueTriggerDefinition.DeserializeJson(ref reader, options);
                break;

            case "valueUsageContext":
                ValueUsageContext = new Fhir.R4.Models.UsageContext();
                ValueUsageContext.DeserializeJson(ref reader, options);
                break;

            case "valueDosage":
                ValueDosage = new Fhir.R4.Models.Dosage();
                ValueDosage.DeserializeJson(ref reader, options);
                break;

            case "valueMeta":
                ValueMeta = new Fhir.R4.Models.Meta();
                ValueMeta.DeserializeJson(ref reader, options);
                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "address":
                Address = reader.GetString();
                break;

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

            case "connectionType":
                ConnectionType = new Fhir.R4.Models.Coding();
                ConnectionType.DeserializeJson(ref reader, options);
                break;

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

                Contact = new List <ContactPoint>();

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

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

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

                break;

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

                Header = new List <string>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Header.Add(reader.GetString());

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

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

                break;

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

                _Header = new List <Element>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Element obj_Header = new Fhir.R4.Models.Element();
                    obj_Header.DeserializeJson(ref reader, options);
                    _Header.Add(obj_Header);

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

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

                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

            case "managingOrganization":
                ManagingOrganization = new Fhir.R4.Models.Reference();
                ManagingOrganization.DeserializeJson(ref reader, options);
                break;

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

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

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

                PayloadMimeType = new List <string>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    PayloadMimeType.Add(reader.GetString());

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

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

                break;

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

                _PayloadMimeType = new List <Element>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Element obj_PayloadMimeType = new Fhir.R4.Models.Element();
                    obj_PayloadMimeType.DeserializeJson(ref reader, options);
                    _PayloadMimeType.Add(obj_PayloadMimeType);

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

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

                break;

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

                PayloadType = new List <CodeableConcept>();

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

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

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

                break;

            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.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;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "channel":
                Channel = new Fhir.R4.Models.SubscriptionChannel();
                Channel.DeserializeJson(ref reader, options);
                break;

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

                Contact = new List <ContactPoint>();

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

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

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

                break;

            case "criteria":
                Criteria = reader.GetString();
                break;

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

            case "end":
                End = reader.GetString();
                break;

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

            case "error":
                Error = reader.GetString();
                break;

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

            case "reason":
                Reason = reader.GetString();
                break;

            case "_reason":
                _Reason = new Fhir.R4.Models.Element();
                _Reason.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;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

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

                Address = new List <Address>();

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

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

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

                break;

            case "birthDate":
                BirthDate = reader.GetString();
                break;

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

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

                Communication = new List <PatientCommunication>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.PatientCommunication objCommunication = new Fhir.R4.Models.PatientCommunication();
                    objCommunication.DeserializeJson(ref reader, options);
                    Communication.Add(objCommunication);

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

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

                break;

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

                Contact = new List <PatientContact>();

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

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

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

                break;

            case "deceasedBoolean":
                DeceasedBoolean = reader.GetBoolean();
                break;

            case "deceasedDateTime":
                DeceasedDateTime = reader.GetString();
                break;

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

            case "gender":
                Gender = reader.GetString();
                break;

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

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

                GeneralPractitioner = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objGeneralPractitioner = new Fhir.R4.Models.Reference();
                    objGeneralPractitioner.DeserializeJson(ref reader, options);
                    GeneralPractitioner.Add(objGeneralPractitioner);

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

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

                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Link = new List <PatientLink>();

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

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

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

                break;

            case "managingOrganization":
                ManagingOrganization = new Fhir.R4.Models.Reference();
                ManagingOrganization.DeserializeJson(ref reader, options);
                break;

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

            case "multipleBirthBoolean":
                MultipleBirthBoolean = reader.GetBoolean();
                break;

            case "multipleBirthInteger":
                MultipleBirthInteger = reader.GetInt32();
                break;

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

                Name = new List <HumanName>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HumanName objName = new Fhir.R4.Models.HumanName();
                    objName.DeserializeJson(ref reader, options);
                    Name.Add(objName);

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

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

                break;

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

                Photo = new List <Attachment>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Attachment objPhoto = new Fhir.R4.Models.Attachment();
                    objPhoto.DeserializeJson(ref reader, options);
                    Photo.Add(objPhoto);

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

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

                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "address":
                Address = new Fhir.R4.Models.Address();
                Address.DeserializeJson(ref reader, options);
                break;

            case "gender":
                Gender = reader.GetString();
                break;

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

            case "name":
                Name = new Fhir.R4.Models.HumanName();
                Name.DeserializeJson(ref reader, options);
                break;

            case "organization":
                Organization = new Fhir.R4.Models.Reference();
                Organization.DeserializeJson(ref reader, options);
                break;

            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

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

                Relationship = new List <CodeableConcept>();

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

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

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

                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

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

                Category = new List <CodeableConcept>();

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

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

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

                break;

            case "encounter":
                Encounter = new Fhir.R4.Models.Reference();
                Encounter.DeserializeJson(ref reader, options);
                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                ManagingOrganization = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objManagingOrganization = new Fhir.R4.Models.Reference();
                    objManagingOrganization.DeserializeJson(ref reader, options);
                    ManagingOrganization.Add(objManagingOrganization);

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

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

                break;

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

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

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

                Note = new List <Annotation>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Annotation objNote = new Fhir.R4.Models.Annotation();
                    objNote.DeserializeJson(ref reader, options);
                    Note.Add(objNote);

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

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

                break;

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

                Participant = new List <CareTeamParticipant>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.CareTeamParticipant objParticipant = new Fhir.R4.Models.CareTeamParticipant();
                    objParticipant.DeserializeJson(ref reader, options);
                    Participant.Add(objParticipant);

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

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

                break;

            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

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

                ReasonCode = new List <CodeableConcept>();

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

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

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

                break;

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

                ReasonReference = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objReasonReference = new Fhir.R4.Models.Reference();
                    objReasonReference.DeserializeJson(ref reader, options);
                    ReasonReference.Add(objReasonReference);

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

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

                break;

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

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

            case "subject":
                Subject = new Fhir.R4.Models.Reference();
                Subject.DeserializeJson(ref reader, options);
                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

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

                Address = new List <Address>();

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

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

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

                break;

            case "birthDate":
                BirthDate = reader.GetString();
                break;

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

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

                Communication = new List <CodeableConcept>();

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

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

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

                break;

            case "gender":
                Gender = reader.GetString();
                break;

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

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Name = new List <HumanName>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HumanName objName = new Fhir.R4.Models.HumanName();
                    objName.DeserializeJson(ref reader, options);
                    Name.Add(objName);

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

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

                break;

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

                Photo = new List <Attachment>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Attachment objPhoto = new Fhir.R4.Models.Attachment();
                    objPhoto.DeserializeJson(ref reader, options);
                    Photo.Add(objPhoto);

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

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

                break;

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

                Qualification = new List <PractitionerQualification>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.PractitionerQualification objQualification = new Fhir.R4.Models.PractitionerQualification();
                    objQualification.DeserializeJson(ref reader, options);
                    Qualification.Add(objQualification);

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

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

                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "url":
                Url = reader.GetString();
                break;

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

            case "valueBase64Binary":
                ValueBase64Binary = reader.GetString();
                break;

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

            case "valueBoolean":
                ValueBoolean = reader.GetBoolean();
                break;

            case "valueCanonical":
                ValueCanonical = reader.GetString();
                break;

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

            case "valueCode":
                ValueCode = reader.GetString();
                break;

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

            case "valueDate":
                ValueDate = reader.GetString();
                break;

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

            case "valueDateTime":
                ValueDateTime = reader.GetString();
                break;

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

            case "valueDecimal":
                ValueDecimal = reader.GetDecimal();
                break;

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

            case "valueId":
                ValueId = reader.GetString();
                break;

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

            case "valueInstant":
                ValueInstant = reader.GetString();
                break;

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

            case "valueInteger":
                ValueInteger = reader.GetInt32();
                break;

            case "valueMarkdown":
                ValueMarkdown = reader.GetString();
                break;

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

            case "valueOid":
                ValueOid = reader.GetString();
                break;

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

            case "valuePositiveInt":
                ValuePositiveInt = reader.GetUInt32();
                break;

            case "valueString":
                ValueString = reader.GetString();
                break;

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

            case "valueTime":
                ValueTime = reader.GetString();
                break;

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

            case "valueUnsignedInt":
                ValueUnsignedInt = reader.GetUInt32();
                break;

            case "valueUri":
                ValueUri = reader.GetString();
                break;

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

            case "valueUrl":
                ValueUrl = reader.GetString();
                break;

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

            case "valueUuid":
                ValueUuid = reader.GetGuid();
                break;

            case "valueAddress":
                ValueAddress = new Fhir.R4.Models.Address();
                ValueAddress.DeserializeJson(ref reader, options);
                break;

            case "valueAge":
                ValueAge = new Fhir.R4.Models.Age();
                ValueAge.DeserializeJson(ref reader, options);
                break;

            case "valueAnnotation":
                ValueAnnotation = new Fhir.R4.Models.Annotation();
                ValueAnnotation.DeserializeJson(ref reader, options);
                break;

            case "valueAttachment":
                ValueAttachment = new Fhir.R4.Models.Attachment();
                ValueAttachment.DeserializeJson(ref reader, options);
                break;

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

            case "valueCoding":
                ValueCoding = new Fhir.R4.Models.Coding();
                ValueCoding.DeserializeJson(ref reader, options);
                break;

            case "valueContactPoint":
                ValueContactPoint = new Fhir.R4.Models.ContactPoint();
                ValueContactPoint.DeserializeJson(ref reader, options);
                break;

            case "valueCount":
                ValueCount = new Fhir.R4.Models.Count();
                ValueCount.DeserializeJson(ref reader, options);
                break;

            case "valueDistance":
                ValueDistance = new Fhir.R4.Models.Distance();
                ValueDistance.DeserializeJson(ref reader, options);
                break;

            case "valueDuration":
                ValueDuration = new Fhir.R4.Models.Duration();
                ValueDuration.DeserializeJson(ref reader, options);
                break;

            case "valueHumanName":
                ValueHumanName = new Fhir.R4.Models.HumanName();
                ValueHumanName.DeserializeJson(ref reader, options);
                break;

            case "valueIdentifier":
                ValueIdentifier = new Fhir.R4.Models.Identifier();
                ValueIdentifier.DeserializeJson(ref reader, options);
                break;

            case "valueMoney":
                ValueMoney = new Fhir.R4.Models.Money();
                ValueMoney.DeserializeJson(ref reader, options);
                break;

            case "valuePeriod":
                ValuePeriod = new Fhir.R4.Models.Period();
                ValuePeriod.DeserializeJson(ref reader, options);
                break;

            case "valueQuantity":
                ValueQuantity = new Fhir.R4.Models.Quantity();
                ValueQuantity.DeserializeJson(ref reader, options);
                break;

            case "valueRange":
                ValueRange = new Fhir.R4.Models.Range();
                ValueRange.DeserializeJson(ref reader, options);
                break;

            case "valueRatio":
                ValueRatio = new Fhir.R4.Models.Ratio();
                ValueRatio.DeserializeJson(ref reader, options);
                break;

            case "valueReference":
                ValueReference = new Fhir.R4.Models.Reference();
                ValueReference.DeserializeJson(ref reader, options);
                break;

            case "valueSampledData":
                ValueSampledData = new Fhir.R4.Models.SampledData();
                ValueSampledData.DeserializeJson(ref reader, options);
                break;

            case "valueSignature":
                ValueSignature = new Fhir.R4.Models.Signature();
                ValueSignature.DeserializeJson(ref reader, options);
                break;

            case "valueTiming":
                ValueTiming = new Fhir.R4.Models.Timing();
                ValueTiming.DeserializeJson(ref reader, options);
                break;

            case "valueContactDetail":
                ValueContactDetail = new Fhir.R4.Models.ContactDetail();
                ValueContactDetail.DeserializeJson(ref reader, options);
                break;

            case "valueContributor":
                ValueContributor = new Fhir.R4.Models.Contributor();
                ValueContributor.DeserializeJson(ref reader, options);
                break;

            case "valueDataRequirement":
                ValueDataRequirement = new Fhir.R4.Models.DataRequirement();
                ValueDataRequirement.DeserializeJson(ref reader, options);
                break;

            case "valueExpression":
                ValueExpression = new Fhir.R4.Models.Expression();
                ValueExpression.DeserializeJson(ref reader, options);
                break;

            case "valueParameterDefinition":
                ValueParameterDefinition = new Fhir.R4.Models.ParameterDefinition();
                ValueParameterDefinition.DeserializeJson(ref reader, options);
                break;

            case "valueRelatedArtifact":
                ValueRelatedArtifact = new Fhir.R4.Models.RelatedArtifact();
                ValueRelatedArtifact.DeserializeJson(ref reader, options);
                break;

            case "valueTriggerDefinition":
                ValueTriggerDefinition = new Fhir.R4.Models.TriggerDefinition();
                ValueTriggerDefinition.DeserializeJson(ref reader, options);
                break;

            case "valueUsageContext":
                ValueUsageContext = new Fhir.R4.Models.UsageContext();
                ValueUsageContext.DeserializeJson(ref reader, options);
                break;

            case "valueDosage":
                ValueDosage = new Fhir.R4.Models.Dosage();
                ValueDosage.DeserializeJson(ref reader, options);
                break;

            case "valueMeta":
                ValueMeta = new Fhir.R4.Models.Meta();
                ValueMeta.DeserializeJson(ref reader, options);
                break;

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

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

                Address = new List <Address>();

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

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

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

                break;

            case "birthDate":
                BirthDate = reader.GetString();
                break;

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

            case "gender":
                Gender = reader.GetString();
                break;

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

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Link = new List <PersonLink>();

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

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

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

                break;

            case "managingOrganization":
                ManagingOrganization = new Fhir.R4.Models.Reference();
                ManagingOrganization.DeserializeJson(ref reader, options);
                break;

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

                Name = new List <HumanName>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HumanName objName = new Fhir.R4.Models.HumanName();
                    objName.DeserializeJson(ref reader, options);
                    Name.Add(objName);

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

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

                break;

            case "photo":
                Photo = new Fhir.R4.Models.Attachment();
                Photo.DeserializeJson(ref reader, options);
                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

            case "appointmentRequired":
                AppointmentRequired = reader.GetBoolean();
                break;

            case "availabilityExceptions":
                AvailabilityExceptions = reader.GetString();
                break;

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

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

                AvailableTime = new List <HealthcareServiceAvailableTime>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HealthcareServiceAvailableTime objAvailableTime = new Fhir.R4.Models.HealthcareServiceAvailableTime();
                    objAvailableTime.DeserializeJson(ref reader, options);
                    AvailableTime.Add(objAvailableTime);

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

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

                break;

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

                Category = new List <CodeableConcept>();

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

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

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

                break;

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

                Characteristic = new List <CodeableConcept>();

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

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

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

                break;

            case "comment":
                Comment = reader.GetString();
                break;

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

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

                Communication = new List <CodeableConcept>();

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

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

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

                break;

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

                CoverageArea = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objCoverageArea = new Fhir.R4.Models.Reference();
                    objCoverageArea.DeserializeJson(ref reader, options);
                    CoverageArea.Add(objCoverageArea);

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

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

                break;

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

                Eligibility = new List <HealthcareServiceEligibility>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HealthcareServiceEligibility objEligibility = new Fhir.R4.Models.HealthcareServiceEligibility();
                    objEligibility.DeserializeJson(ref reader, options);
                    Eligibility.Add(objEligibility);

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

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

                break;

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

                Endpoint = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objEndpoint = new Fhir.R4.Models.Reference();
                    objEndpoint.DeserializeJson(ref reader, options);
                    Endpoint.Add(objEndpoint);

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

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

                break;

            case "extraDetails":
                ExtraDetails = reader.GetString();
                break;

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

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Location = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objLocation = new Fhir.R4.Models.Reference();
                    objLocation.DeserializeJson(ref reader, options);
                    Location.Add(objLocation);

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

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

                break;

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

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

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

                NotAvailable = new List <HealthcareServiceNotAvailable>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.HealthcareServiceNotAvailable objNotAvailable = new Fhir.R4.Models.HealthcareServiceNotAvailable();
                    objNotAvailable.DeserializeJson(ref reader, options);
                    NotAvailable.Add(objNotAvailable);

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

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

                break;

            case "photo":
                Photo = new Fhir.R4.Models.Attachment();
                Photo.DeserializeJson(ref reader, options);
                break;

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

                Program = new List <CodeableConcept>();

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

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

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

                break;

            case "providedBy":
                ProvidedBy = new Fhir.R4.Models.Reference();
                ProvidedBy.DeserializeJson(ref reader, options);
                break;

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

                ReferralMethod = new List <CodeableConcept>();

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

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

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

                break;

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

                ServiceProvisionCode = new List <CodeableConcept>();

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

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

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

                break;

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

                Specialty = new List <CodeableConcept>();

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

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

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

                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

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

                Type = new List <CodeableConcept>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "address":
                Address = new Fhir.R4.Models.Address();
                Address.DeserializeJson(ref reader, options);
                break;

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

                Alias = new List <string>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Alias.Add(reader.GetString());

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

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

                break;

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

                _Alias = new List <Element>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Element obj_Alias = new Fhir.R4.Models.Element();
                    obj_Alias.DeserializeJson(ref reader, options);
                    _Alias.Add(obj_Alias);

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

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

                break;

            case "availabilityExceptions":
                AvailabilityExceptions = reader.GetString();
                break;

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

                Endpoint = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objEndpoint = new Fhir.R4.Models.Reference();
                    objEndpoint.DeserializeJson(ref reader, options);
                    Endpoint.Add(objEndpoint);

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

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

                break;

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

                HoursOfOperation = new List <LocationHoursOfOperation>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.LocationHoursOfOperation objHoursOfOperation = new Fhir.R4.Models.LocationHoursOfOperation();
                    objHoursOfOperation.DeserializeJson(ref reader, options);
                    HoursOfOperation.Add(objHoursOfOperation);

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

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

                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

            case "managingOrganization":
                ManagingOrganization = new Fhir.R4.Models.Reference();
                ManagingOrganization.DeserializeJson(ref reader, options);
                break;

            case "mode":
                Mode = reader.GetString();
                break;

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

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

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

            case "operationalStatus":
                OperationalStatus = new Fhir.R4.Models.Coding();
                OperationalStatus.DeserializeJson(ref reader, options);
                break;

            case "partOf":
                PartOf = new Fhir.R4.Models.Reference();
                PartOf.DeserializeJson(ref reader, options);
                break;

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

            case "position":
                Position = new Fhir.R4.Models.LocationPosition();
                Position.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 "telecom":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

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

                Type = new List <CodeableConcept>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "active":
                Active = reader.GetBoolean();
                break;

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

                Address = new List <Address>();

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

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

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

                break;

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

                Alias = new List <string>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Alias.Add(reader.GetString());

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

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

                break;

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

                _Alias = new List <Element>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Element obj_Alias = new Fhir.R4.Models.Element();
                    obj_Alias.DeserializeJson(ref reader, options);
                    _Alias.Add(obj_Alias);

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

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

                break;

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

                Contact = new List <OrganizationContact>();

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

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

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

                break;

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

                Endpoint = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objEndpoint = new Fhir.R4.Models.Reference();
                    objEndpoint.DeserializeJson(ref reader, options);
                    Endpoint.Add(objEndpoint);

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

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

                break;

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

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

            case "partOf":
                PartOf = new Fhir.R4.Models.Reference();
                PartOf.DeserializeJson(ref reader, options);
                break;

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

                Telecom = new List <ContactPoint>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.ContactPoint objTelecom = new Fhir.R4.Models.ContactPoint();
                    objTelecom.DeserializeJson(ref reader, options);
                    Telecom.Add(objTelecom);

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

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

                break;

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

                Type = new List <CodeableConcept>();

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

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

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

                break;

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