예제 #1
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;
            }
        }
예제 #2
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 "destination":
                Destination = new Fhir.R4.Models.Reference();
                Destination.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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

            case "occurrenceTiming":
                OccurrenceTiming = new Fhir.R4.Models.Timing();
                OccurrenceTiming.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 "patient":
                Patient = new Fhir.R4.Models.Reference();
                Patient.DeserializeJson(ref reader, options);
                break;

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

                Receiver = new List <Reference>();

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

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

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

                break;

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

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

            case "suppliedItem":
                SuppliedItem = new Fhir.R4.Models.SupplyDeliverySuppliedItem();
                SuppliedItem.DeserializeJson(ref reader, options);
                break;

            case "supplier":
                Supplier = new Fhir.R4.Models.Reference();
                Supplier.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;
            }
        }
예제 #3
0
        /// <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 "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 "code":
                Code = new Fhir.R4.Models.CodeableConcept();
                Code.DeserializeJson(ref reader, options);
                break;

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

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

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

                DefinitionCanonical = new List <string>();

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

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

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

                break;

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

                _DefinitionCanonical = new List <Element>();

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

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

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

                break;

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

                DefinitionUri = new List <string>();

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

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

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

                break;

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

                _DefinitionUri = new List <Element>();

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

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

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

                break;

            case "enteredDate":
                EnteredDate = reader.GetString();
                break;

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

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

            case "factorOverride":
                FactorOverride = reader.GetDecimal();
                break;

            case "_factorOverride":
                _FactorOverride = new Fhir.R4.Models.Element();
                _FactorOverride.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 "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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

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

            case "overrideReason":
                OverrideReason = reader.GetString();
                break;

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

                Performer = new List <ChargeItemPerformer>();

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

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

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

                break;

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

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

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

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

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

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

                Reason = new List <CodeableConcept>();

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

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

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

                break;

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

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

                Service = new List <Reference>();

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

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

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

                SupportingInformation = new List <Reference>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
예제 #4
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "authoredOn":
                AuthoredOn = reader.GetString();
                break;

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

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

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

            case "deliverTo":
                DeliverTo = new Fhir.R4.Models.Reference();
                DeliverTo.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 "itemCodeableConcept":
                ItemCodeableConcept = new Fhir.R4.Models.CodeableConcept();
                ItemCodeableConcept.DeserializeJson(ref reader, options);
                break;

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

            case "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

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

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

                Parameter = new List <SupplyRequestParameter>();

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

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

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

                break;

            case "priority":
                Priority = reader.GetString();
                break;

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

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

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

                ReasonCode = new List <CodeableConcept>();

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

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

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

                break;

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

                ReasonReference = new List <Reference>();

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

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

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

                break;

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

                Supplier = new List <Reference>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
예제 #5
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "attestation":
                Attestation = new Fhir.R4.Models.VerificationResultAttestation();
                Attestation.DeserializeJson(ref reader, options);
                break;

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

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

            case "lastPerformed":
                LastPerformed = reader.GetString();
                break;

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

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

            case "nextScheduled":
                NextScheduled = reader.GetString();
                break;

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

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

                PrimarySource = new List <VerificationResultPrimarySource>();

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

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

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

                break;

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

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

                Target = new List <Reference>();

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

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

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

                break;

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

                TargetLocation = new List <string>();

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

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

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

                break;

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

                _TargetLocation = new List <Element>();

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

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

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

                break;

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

                ValidationProcess = new List <CodeableConcept>();

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

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

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

                break;

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

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

                Validator = new List <VerificationResultValidator>();

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

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

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

                break;

            default:
                ((Fhir.R4.Models.DomainResource) 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 "calibration":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Calibration = new List <DeviceMetricCalibration>();

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

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

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

                break;

            case "category":
                Category = reader.GetString();
                break;

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

            case "color":
                Color = reader.GetString();
                break;

            case "_color":
                _Color = new Fhir.R4.Models.Element();
                _Color.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 "measurementPeriod":
                MeasurementPeriod = new Fhir.R4.Models.Timing();
                MeasurementPeriod.DeserializeJson(ref reader, options);
                break;

            case "operationalStatus":
                OperationalStatus = reader.GetString();
                break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            default:
                ((Fhir.R4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
예제 #8
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "authoredOn":
                AuthoredOn = reader.GetString();
                break;

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

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

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

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

            case "groupIdentifier":
                GroupIdentifier = new Fhir.R4.Models.Identifier();
                GroupIdentifier.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 "instantiatesCanonical":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                InstantiatesCanonical = new List <string>();

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

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

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

                break;

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

                _InstantiatesCanonical = new List <Element>();

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

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

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

                break;

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

                InstantiatesUri = new List <string>();

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

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

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

                break;

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

                _InstantiatesUri = new List <Element>();

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

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

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

                break;

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

                Insurance = new List <Reference>();

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

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

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

                break;

            case "intent":
                Intent = reader.GetString();
                break;

            case "_intent":
                _Intent = new Fhir.R4.Models.Element();
                _Intent.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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

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

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

                Parameter = new List <DeviceRequestParameter>();

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

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

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

                break;

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

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

            case "priority":
                Priority = reader.GetString();
                break;

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

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

                PriorRequest = new List <Reference>();

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

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

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

                ReasonReference = new List <Reference>();

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

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

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

                break;

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

                RelevantHistory = new List <Reference>();

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

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

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

                break;

            case "requester":
                Requester = new Fhir.R4.Models.Reference();
                Requester.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":
                Subject = new Fhir.R4.Models.Reference();
                Subject.DeserializeJson(ref reader, options);
                break;

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

                SupportingInfo = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Reference objSupportingInfo = new Fhir.R4.Models.Reference();
                    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;
            }
        }
예제 #9
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "condition":
                Condition = new Fhir.R4.Models.Expression();
                Condition.DeserializeJson(ref reader, options);
                break;

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

                Data = new List <DataRequirement>();

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

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

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

                break;

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

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

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

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

            case "timingDate":
                TimingDate = reader.GetString();
                break;

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

            case "timingDateTime":
                TimingDateTime = reader.GetString();
                break;

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

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

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

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

                DerivedFrom = new List <Reference>();

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

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

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

                break;

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

                ReasonCode = new List <CodeableConcept>();

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

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

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

                break;

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

                ReasonReference = new List <Reference>();

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

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

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

                break;

            case "recordedOn":
                RecordedOn = reader.GetString();
                break;

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

            case "source":
                Source = new Fhir.R4.Models.Reference();
                Source.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":
                Subject = new Fhir.R4.Models.Reference();
                Subject.DeserializeJson(ref reader, options);
                break;

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

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

            case "timingDateTime":
                TimingDateTime = reader.GetString();
                break;

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

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