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

                AuthorizingPrescription = new List <Reference>();

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

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

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

                break;

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

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

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

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

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

                DetectedIssue = new List <Reference>();

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

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

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

                break;

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

                DosageInstruction = new List <Dosage>();

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

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

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

                break;

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

                EventHistory = new List <Reference>();

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

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

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

                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 "location":
                Location = new fhirCsR4.Models.Reference();
                Location.DeserializeJson(ref reader, options);
                break;

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

            case "medicationReference":
                MedicationReference = new fhirCsR4.Models.Reference();
                MedicationReference.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)
                {
                    fhirCsR4.Models.Annotation objNote = new fhirCsR4.Models.Annotation();
                    objNote.DeserializeJson(ref reader, options);
                    Note.Add(objNote);

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

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

                break;

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

                PartOf = new List <Reference>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.Reference objPartOf = new fhirCsR4.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 <MedicationDispensePerformer>();

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

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

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

                break;

            case "quantity":
                Quantity = new fhirCsR4.Models.Quantity();
                Quantity.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)
                {
                    fhirCsR4.Models.Reference objReceiver = new fhirCsR4.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 fhirCsR4.Models.Element();
                _Status.DeserializeJson(ref reader, options);
                break;

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

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

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

            case "substitution":
                Substitution = new fhirCsR4.Models.MedicationDispenseSubstitution();
                Substitution.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)
                {
                    fhirCsR4.Models.Reference objSupportingInformation = new fhirCsR4.Models.Reference();
                    objSupportingInformation.DeserializeJson(ref reader, options);
                    SupportingInformation.Add(objSupportingInformation);

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

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

                break;

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

            case "whenHandedOver":
                WhenHandedOver = reader.GetString();
                break;

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

            case "whenPrepared":
                WhenPrepared = reader.GetString();
                break;

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

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Exemple #3
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)
                {
                    fhirCsR4.Models.Reference objBasedOn = new fhirCsR4.Models.Reference();
                    objBasedOn.DeserializeJson(ref reader, options);
                    BasedOn.Add(objBasedOn);

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

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

                break;

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

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

            case "dateAsserted":
                DateAsserted = reader.GetString();
                break;

            case "_dateAsserted":
                _DateAsserted = new fhirCsR4.Models.Element();
                _DateAsserted.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)
                {
                    fhirCsR4.Models.Reference objDerivedFrom = new fhirCsR4.Models.Reference();
                    objDerivedFrom.DeserializeJson(ref reader, options);
                    DerivedFrom.Add(objDerivedFrom);

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

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

                break;

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

                Dosage = new List <Dosage>();

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

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

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

                break;

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

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

            case "effectivePeriod":
                EffectivePeriod = new fhirCsR4.Models.Period();
                EffectivePeriod.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)
                {
                    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 "informationSource":
                InformationSource = new fhirCsR4.Models.Reference();
                InformationSource.DeserializeJson(ref reader, options);
                break;

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

            case "medicationReference":
                MedicationReference = new fhirCsR4.Models.Reference();
                MedicationReference.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)
                {
                    fhirCsR4.Models.Annotation objNote = new fhirCsR4.Models.Annotation();
                    objNote.DeserializeJson(ref reader, options);
                    Note.Add(objNote);

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

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

                break;

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

                PartOf = new List <Reference>();

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

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

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

                break;

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

                ReasonCode = new List <CodeableConcept>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.CodeableConcept objReasonCode = new fhirCsR4.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)
                {
                    fhirCsR4.Models.Reference objReasonReference = new fhirCsR4.Models.Reference();
                    objReasonReference.DeserializeJson(ref reader, options);
                    ReasonReference.Add(objReasonReference);

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

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

                break;

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

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

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

                StatusReason = new List <CodeableConcept>();

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

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

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

                break;

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

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