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

                Application = new List <MedicinalProductAuthorizationProcedure>();

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

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

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

                break;

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

            case "dateDateTime":
                DateDateTime = reader.GetString();
                break;

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

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "collectedDateTime":
                CollectedDateTime = reader.GetString();
                break;

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

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

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #3
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "bodySite":
                BodySite = new Fhir.R4.Models.CodeableConcept();
                BodySite.DeserializeJson(ref reader, options);
                break;

            case "collectedDateTime":
                CollectedDateTime = reader.GetString();
                break;

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

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

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

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

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

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

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #4
0
ファイル: Identifier.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "assigner":
                Assigner = new Fhir.R4.Models.Reference();
                Assigner.DeserializeJson(ref reader, options);
                break;

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

            case "system":
                System = reader.GetString();
                break;

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

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

            case "use":
                Use = reader.GetString();
                break;

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

            case "value":
                Value = reader.GetString();
                break;

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

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #5
0
ファイル: CareTeam.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "member":
                Member = new Fhir.R4.Models.Reference();
                Member.DeserializeJson(ref reader, options);
                break;

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

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

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

                Role = new List <CodeableConcept>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #6
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "benefitPeriod":
                BenefitPeriod = new Fhir.R4.Models.Period();
                BenefitPeriod.DeserializeJson(ref reader, options);
                break;

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

            case "inforce":
                Inforce = reader.GetBoolean();
                break;

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

                Item = new List <CoverageEligibilityResponseInsuranceItem>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #7
0
ファイル: Group.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "code":
                Code = new Fhir.R4.Models.CodeableConcept();
                Code.DeserializeJson(ref reader, options);
                break;

            case "exclude":
                Exclude = reader.GetBoolean();
                break;

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

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

            case "valueBoolean":
                ValueBoolean = reader.GetBoolean();
                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 "valueReference":
                ValueReference = new Fhir.R4.Models.Reference();
                ValueReference.DeserializeJson(ref reader, options);
                break;

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #8
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "path":
                Path = reader.GetString();
                break;

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

            case "searchParam":
                SearchParam = reader.GetString();
                break;

            case "_searchParam":
                _SearchParam = new Fhir.R4.Models.Element();
                _SearchParam.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 "valuePeriod":
                ValuePeriod = new Fhir.R4.Models.Period();
                ValuePeriod.DeserializeJson(ref reader, options);
                break;

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

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #9
0
ファイル: NamingSystem.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "comment":
                Comment = reader.GetString();
                break;

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

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

            case "preferred":
                Preferred = reader.GetBoolean();
                break;

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

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

            case "value":
                Value = reader.GetString();
                break;

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #10
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

            case "rank":
                Rank = reader.GetUInt32();
                break;

            case "system":
                System = reader.GetString();
                break;

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

            case "use":
                Use = reader.GetString();
                break;

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

            case "value":
                Value = reader.GetString();
                break;

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

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #11
0
ファイル: Coverage.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "period":
                Period = new Fhir.R4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #12
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "description":
                Description = reader.GetString();
                break;

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

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

            case "scale":
                Scale = reader.GetString();
                break;

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

            case "temperature":
                Temperature = reader.GetDecimal();
                break;

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #13
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "country":
                Country = new Fhir.R4.Models.CodeableConcept();
                Country.DeserializeJson(ref reader, options);
                break;

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

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

            case "restoreDate":
                RestoreDate = reader.GetString();
                break;

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #14
0
ファイル: EpisodeOfCare.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            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.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #15
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "country":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Country = new List <CodeableConcept>();

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

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

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

                break;

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

            case "dateOfFirstAuthorization":
                DateOfFirstAuthorization = reader.GetString();
                break;

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

            case "holder":
                Holder = new Fhir.R4.Models.Reference();
                Holder.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 "internationalBirthDate":
                InternationalBirthDate = reader.GetString();
                break;

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

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

                Jurisdiction = new List <CodeableConcept>();

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

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

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

                break;

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

                JurisdictionalAuthorization = new List <MedicinalProductAuthorizationJurisdictionalAuthorization>();

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

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

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

                break;

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

            case "procedure":
                Procedure = new Fhir.R4.Models.MedicinalProductAuthorizationProcedure();
                Procedure.DeserializeJson(ref reader, options);
                break;

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

            case "restoreDate":
                RestoreDate = reader.GetString();
                break;

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

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

            case "statusDate":
                StatusDate = reader.GetString();
                break;

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

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

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

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #16
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "created":
                Created = reader.GetString();
                break;

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

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

            case "facility":
                Facility = new Fhir.R4.Models.Reference();
                Facility.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 "insurance":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Insurance = new List <CoverageEligibilityRequestInsurance>();

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

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

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

                break;

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

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

                Item = new List <CoverageEligibilityRequestItem>();

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

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

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

                break;

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

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

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

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

                Purpose = new List <string>();

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

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

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

                break;

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

                _Purpose = new List <Element>();

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

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

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

                break;

            case "servicedDate":
                ServicedDate = reader.GetString();
                break;

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

            case "servicedPeriod":
                ServicedPeriod = new Fhir.R4.Models.Period();
                ServicedPeriod.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 "supportingInfo":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                SupportingInfo = new List <CoverageEligibilityRequestSupportingInfo>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #17
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "basedOn":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                BasedOn = new List <Reference>();

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

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

                if (BasedOn.Count == 0)
                {
                    BasedOn = 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 "code":
                Code = new Fhir.R4.Models.CodeableConcept();
                Code.DeserializeJson(ref reader, options);
                break;

            case "conclusion":
                Conclusion = reader.GetString();
                break;

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

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

                ConclusionCode = new List <CodeableConcept>();

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

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

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

                break;

            case "effectiveDateTime":
                EffectiveDateTime = reader.GetString();
                break;

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

            case "effectivePeriod":
                EffectivePeriod = new Fhir.R4.Models.Period();
                EffectivePeriod.DeserializeJson(ref reader, options);
                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 "imagingStudy":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                ImagingStudy = new List <Reference>();

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

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

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

                break;

            case "issued":
                Issued = reader.GetString();
                break;

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

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

                Media = new List <DiagnosticReportMedia>();

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

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

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

                break;

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

                Performer = new List <Reference>();

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

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

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

                break;

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

                PresentedForm = new List <Attachment>();

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

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

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

                break;

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

                Result = new List <Reference>();

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

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

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

                break;

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

                ResultsInterpreter = new List <Reference>();

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

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

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

                break;

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

                Specimen = new List <Reference>();

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

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

                if (Specimen.Count == 0)
                {
                    Specimen = 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;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #18
0
ファイル: Condition.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "abatementDateTime":
                AbatementDateTime = reader.GetString();
                break;

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

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

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

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

            case "abatementString":
                AbatementString = reader.GetString();
                break;

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

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

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

                BodySite = new List <CodeableConcept>();

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

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

                if (BodySite.Count == 0)
                {
                    BodySite = 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 "clinicalStatus":
                ClinicalStatus = new Fhir.R4.Models.CodeableConcept();
                ClinicalStatus.DeserializeJson(ref reader, options);
                break;

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

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

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

                Evidence = new List <ConditionEvidence>();

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

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

                if (Evidence.Count == 0)
                {
                    Evidence = 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 "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 "onsetDateTime":
                OnsetDateTime = reader.GetString();
                break;

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

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

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

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

            case "onsetString":
                OnsetString = reader.GetString();
                break;

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

            case "recordedDate":
                RecordedDate = reader.GetString();
                break;

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

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

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

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

                Stage = new List <ConditionStage>();

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

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

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

                break;

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

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

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #19
0
ファイル: Account.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "coverage":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Coverage = new List <AccountCoverage>();

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

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

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

                break;

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

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

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

                Guarantor = new List <AccountGuarantor>();

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

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

                if (Guarantor.Count == 0)
                {
                    Guarantor = 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 "owner":
                Owner = new Fhir.R4.Models.Reference();
                Owner.DeserializeJson(ref reader, options);
                break;

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

            case "servicePeriod":
                ServicePeriod = new Fhir.R4.Models.Period();
                ServicePeriod.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 "subject":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Subject = new List <Reference>();

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

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

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

                break;

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

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #20
0
ファイル: Address.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "city":
                City = reader.GetString();
                break;

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

            case "country":
                Country = reader.GetString();
                break;

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

            case "district":
                District = reader.GetString();
                break;

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

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

                Line = new List <string>();

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

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

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

                break;

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

                _Line = new List <Element>();

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

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

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

                break;

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

            case "postalCode":
                PostalCode = reader.GetString();
                break;

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

            case "state":
                State = reader.GetString();
                break;

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

            case "text":
                Text = reader.GetString();
                break;

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

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

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

            case "use":
                Use = reader.GetString();
                break;

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

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #21
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;
            }
        }
コード例 #22
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "additionalCharacteristic":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                AdditionalCharacteristic = new List <CodeableConcept>();

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

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

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

                break;

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

                AdditionalClassification = new List <CodeableConcept>();

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

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

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

                break;

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

                AdditionalIdentifier = new List <Identifier>();

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

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

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

                break;

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

                Classification = new List <CodeableConcept>();

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

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

                if (Classification.Count == 0)
                {
                    Classification = 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 "lastUpdated":
                LastUpdated = reader.GetString();
                break;

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

            case "orderable":
                Orderable = reader.GetBoolean();
                break;

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

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

                RelatedEntry = new List <CatalogEntryRelatedEntry>();

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

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

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

                break;

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

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

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

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

            case "validTo":
                ValidTo = reader.GetString();
                break;

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

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #23
0
ファイル: Media.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "basedOn":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                BasedOn = new List <Reference>();

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

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

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

                break;

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

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

            case "createdDateTime":
                CreatedDateTime = reader.GetString();
                break;

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

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

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

            case "deviceName":
                DeviceName = reader.GetString();
                break;

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

            case "duration":
                Duration = reader.GetDecimal();
                break;

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

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

            case "frames":
                Frames = reader.GetUInt32();
                break;

            case "height":
                Height = reader.GetUInt32();
                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 "issued":
                Issued = reader.GetString();
                break;

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

            case "modality":
                Modality = new Fhir.R4.Models.CodeableConcept();
                Modality.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 "operator":
                Operator = new Fhir.R4.Models.Reference();
                Operator.DeserializeJson(ref reader, options);
                break;

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

                PartOf = new List <Reference>();

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

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

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

                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 "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 "type":
                Type = new Fhir.R4.Models.CodeableConcept();
                Type.DeserializeJson(ref reader, options);
                break;

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

            case "width":
                Width = reader.GetUInt32();
                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #24
0
ファイル: Coverage.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "beneficiary":
                Beneficiary = new Fhir.R4.Models.Reference();
                Beneficiary.DeserializeJson(ref reader, options);
                break;

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

                Class = new List <CoverageClass>();

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

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

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

                break;

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

                Contract = new List <Reference>();

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

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

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

                break;

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

                CostToBeneficiary = new List <CoverageCostToBeneficiary>();

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

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

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

                break;

            case "dependent":
                Dependent = reader.GetString();
                break;

            case "_dependent":
                _Dependent = new Fhir.R4.Models.Element();
                _Dependent.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 "network":
                Network = reader.GetString();
                break;

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

            case "order":
                Order = reader.GetUInt32();
                break;

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

                Payor = new List <Reference>();

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

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

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

                break;

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

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

            case "relationship":
                Relationship = new Fhir.R4.Models.CodeableConcept();
                Relationship.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 "subrogation":
                Subrogation = reader.GetBoolean();
                break;

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

            case "subscriberId":
                SubscriberId = reader.GetString();
                break;

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

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

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #25
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "author":
                Author = new Fhir.R4.Models.Reference();
                Author.DeserializeJson(ref reader, options);
                break;

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

            case "detail":
                Detail = reader.GetString();
                break;

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

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

                Evidence = new List <DetectedIssueEvidence>();

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

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

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

                break;

            case "identifiedDateTime":
                IdentifiedDateTime = reader.GetString();
                break;

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

            case "identifiedPeriod":
                IdentifiedPeriod = new Fhir.R4.Models.Period();
                IdentifiedPeriod.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 "implicated":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Implicated = new List <Reference>();

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

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

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

                break;

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

                Mitigation = new List <DetectedIssueMitigation>();

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

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

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

                break;

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

            case "reference":
                Reference = reader.GetString();
                break;

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

            case "severity":
                Severity = reader.GetString();
                break;

            case "_severity":
                _Severity = new Fhir.R4.Models.Element();
                _Severity.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;
            }
        }
コード例 #26
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "created":
                Created = reader.GetString();
                break;

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

            case "disposition":
                Disposition = reader.GetString();
                break;

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

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

                Error = new List <CoverageEligibilityResponseError>();

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

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

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

                break;

            case "form":
                Form = new Fhir.R4.Models.CodeableConcept();
                Form.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 "insurance":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Insurance = new List <CoverageEligibilityResponseInsurance>();

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

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

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

                break;

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

            case "outcome":
                Outcome = reader.GetString();
                break;

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

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

            case "preAuthRef":
                PreAuthRef = reader.GetString();
                break;

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

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

                Purpose = new List <string>();

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

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

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

                break;

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

                _Purpose = new List <Element>();

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

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

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

                break;

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

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

            case "servicedDate":
                ServicedDate = reader.GetString();
                break;

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

            case "servicedPeriod":
                ServicedPeriod = new Fhir.R4.Models.Period();
                ServicedPeriod.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;
            }
        }
コード例 #27
0
ファイル: Consent.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "action":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Action = new List <CodeableConcept>();

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

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

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

                break;

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

                Actor = new List <ConsentProvisionActor>();

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

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

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

                break;

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

                Class = new List <Coding>();

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

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

                if (Class.Count == 0)
                {
                    Class = 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 "data":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Data = new List <ConsentProvisionData>();

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

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

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

                break;

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

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

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

                Provision = new List <ConsentProvision>();

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

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

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

                break;

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

                Purpose = new List <Coding>();

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

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

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

                break;

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

                SecurityLabel = new List <Coding>();

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

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

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

                break;

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
コード例 #28
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "created":
                Created = reader.GetString();
                break;

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

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

                Detail = new List <PaymentReconciliationDetail>();

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

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

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

                break;

            case "disposition":
                Disposition = reader.GetString();
                break;

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

            case "formCode":
                FormCode = new Fhir.R4.Models.CodeableConcept();
                FormCode.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 "outcome":
                Outcome = reader.GetString();
                break;

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

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

            case "paymentDate":
                PaymentDate = reader.GetString();
                break;

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

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

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

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

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

                ProcessNote = new List <PaymentReconciliationProcessNote>();

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

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

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

                break;

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

            case "requestor":
                Requestor = new Fhir.R4.Models.Reference();
                Requestor.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;
            }
        }
コード例 #29
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;
            }
        }
コード例 #30
0
ファイル: EpisodeOfCare.cs プロジェクト: trifork/fhir-codegen
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "account":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Account = new List <Reference>();

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

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

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

                break;

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

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

                Diagnosis = new List <EpisodeOfCareDiagnosis>();

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

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

                if (Diagnosis.Count == 0)
                {
                    Diagnosis = 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 "patient":
                Patient = new Fhir.R4.Models.Reference();
                Patient.DeserializeJson(ref reader, options);
                break;

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

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

                ReferralRequest = new List <Reference>();

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

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

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

                break;

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

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

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

                StatusHistory = new List <EpisodeOfCareStatusHistory>();

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

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

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

                break;

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

                Team = new List <Reference>();

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

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

                if (Team.Count == 0)
                {
                    Team = 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;
            }
        }