Ejemplo n.º 1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "url":
                Url = reader.GetString();
                break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            default:
                ((fhirCsR4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "approvalDate":
                ApprovalDate = reader.GetString();
                break;

            case "_approvalDate":
                _ApprovalDate = new fhirCsR4.Models.Element();
                _ApprovalDate.DeserializeJson(ref reader, options);
                break;

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

                Author = new List <ContactDetail>();

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

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

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

                break;

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

                Contact = new List <ContactDetail>();

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

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

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

                break;

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

                Content = new List <Attachment>();

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

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

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

                break;

            case "copyright":
                Copyright = reader.GetString();
                break;

            case "_copyright":
                _Copyright = new fhirCsR4.Models.Element();
                _Copyright.DeserializeJson(ref reader, options);
                break;

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

                DataRequirement = new List <DataRequirement>();

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

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

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

                break;

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

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

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

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

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

                Editor = new List <ContactDetail>();

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

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

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

                break;

            case "effectivePeriod":
                EffectivePeriod = new fhirCsR4.Models.Period();
                EffectivePeriod.DeserializeJson(ref reader, options);
                break;

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

                Endorser = new List <ContactDetail>();

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

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

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

                break;

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

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

                Jurisdiction = new List <CodeableConcept>();

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

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

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

                break;

            case "lastReviewDate":
                LastReviewDate = reader.GetString();
                break;

            case "_lastReviewDate":
                _LastReviewDate = new fhirCsR4.Models.Element();
                _LastReviewDate.DeserializeJson(ref reader, options);
                break;

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

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

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

                Parameter = new List <ParameterDefinition>();

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

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

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

                break;

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

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

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

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

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

                RelatedArtifact = new List <RelatedArtifact>();

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

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

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

                break;

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

                Reviewer = new List <ContactDetail>();

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

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

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

                break;

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

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

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

            case "subjectReference":
                SubjectReference = new fhirCsR4.Models.Reference();
                SubjectReference.DeserializeJson(ref reader, options);
                break;

            case "subtitle":
                Subtitle = reader.GetString();
                break;

            case "_subtitle":
                _Subtitle = new fhirCsR4.Models.Element();
                _Subtitle.DeserializeJson(ref reader, options);
                break;

            case "title":
                Title = reader.GetString();
                break;

            case "_title":
                _Title = new fhirCsR4.Models.Element();
                _Title.DeserializeJson(ref reader, options);
                break;

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

                Topic = new List <CodeableConcept>();

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

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

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

                break;

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

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

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

            case "usage":
                Usage = reader.GetString();
                break;

            case "_usage":
                _Usage = new fhirCsR4.Models.Element();
                _Usage.DeserializeJson(ref reader, options);
                break;

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

                UseContext = new List <UsageContext>();

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

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

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

                break;

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

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

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