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

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

                CommunicationMethod = new List <CodeableConcept>();

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

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

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

                break;

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

                PushTypeAvailable = new List <CodeableConcept>();

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

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

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

                break;

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

                Type = new List <CodeableConcept>();

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

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

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

                break;

            case "validationDate":
                ValidationDate = reader.GetString();
                break;

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

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

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

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

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

                Category = new List <CodeableConcept>();

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

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

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

                break;

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

            case "criticalCodedValueSet":
                CriticalCodedValueSet = new fhirCsR4.Models.Reference();
                CriticalCodedValueSet.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 "method":
                Method = new fhirCsR4.Models.CodeableConcept();
                Method.DeserializeJson(ref reader, options);
                break;

            case "multipleResultsAllowed":
                MultipleResultsAllowed = reader.GetBoolean();
                break;

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

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

                PermittedDataType = new List <string>();

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

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

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

                break;

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

                _PermittedDataType = new List <Element>();

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

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

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

                break;

            case "preferredReportName":
                PreferredReportName = reader.GetString();
                break;

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

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

                QualifiedInterval = new List <ObservationDefinitionQualifiedInterval>();

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

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

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

                break;

            case "quantitativeDetails":
                QuantitativeDetails = new fhirCsR4.Models.ObservationDefinitionQuantitativeDetails();
                QuantitativeDetails.DeserializeJson(ref reader, options);
                break;

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

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

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

            case "assignedArm":
                AssignedArm = reader.GetString();
                break;

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

            case "consent":
                Consent = new fhirCsR4.Models.Reference();
                Consent.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 "individual":
                Individual = new fhirCsR4.Models.Reference();
                Individual.DeserializeJson(ref reader, options);
                break;

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

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

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

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

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "author":
                Author = new fhirCsR4.Models.Reference();
                Author.DeserializeJson(ref reader, options);
                break;

            case "authored":
                Authored = reader.GetString();
                break;

            case "_authored":
                _Authored = new fhirCsR4.Models.Element();
                _Authored.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)
                {
                    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 "encounter":
                Encounter = new fhirCsR4.Models.Reference();
                Encounter.DeserializeJson(ref reader, options);
                break;

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

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

                Item = new List <QuestionnaireResponseItem>();

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

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

                if (Item.Count == 0)
                {
                    Item = 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 "questionnaire":
                Questionnaire = reader.GetString();
                break;

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

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

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

            case "_status":
                _Status = new fhirCsR4.Models.Element();
                _Status.DeserializeJson(ref reader, options);
                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;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "author":
                Author = new fhirCsR4.Models.Reference();
                Author.DeserializeJson(ref reader, options);
                break;

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

                Category = new List <CodeableConcept>();

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

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

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

                break;

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

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

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

                Identifier = new List <Identifier>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    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 "period":
                Period = new fhirCsR4.Models.Period();
                Period.DeserializeJson(ref reader, options);
                break;

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

            case "_status":
                _Status = new fhirCsR4.Models.Element();
                _Status.DeserializeJson(ref reader, options);
                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;
            }
        }
Ejemplo n.º 6
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 "description":
                Description = reader.GetString();
                break;

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

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

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

                Endpoint = new List <Reference>();

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

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

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

                break;

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

                Identifier = new List <Identifier>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    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 "interpreter":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Interpreter = new List <Reference>();

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

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

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

                break;

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

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

                Modality = new List <Coding>();

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

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

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

                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 "numberOfInstances":
                NumberOfInstances = reader.GetUInt32();
                break;

            case "numberOfSeries":
                NumberOfSeries = reader.GetUInt32();
                break;

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

                ProcedureCode = new List <CodeableConcept>();

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

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

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

                break;

            case "procedureReference":
                ProcedureReference = new fhirCsR4.Models.Reference();
                ProcedureReference.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)
                {
                    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 "referrer":
                Referrer = new fhirCsR4.Models.Reference();
                Referrer.DeserializeJson(ref reader, options);
                break;

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

                Series = new List <ImagingStudySeries>();

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

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

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

                break;

            case "started":
                Started = reader.GetString();
                break;

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

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

            case "_status":
                _Status = new fhirCsR4.Models.Element();
                _Status.DeserializeJson(ref reader, options);
                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;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "item":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Item = new List <QuestionnaireResponseItem>();

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

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

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

                break;

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

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

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

            case "valueInteger":
                ValueInteger = reader.GetInt32();
                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 "valueTime":
                ValueTime = reader.GetString();
                break;

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

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

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

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

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

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

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

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

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

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

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

            case "_description":
                _Description = new fhirCsR4.Models.Element();
                _Description.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 "image":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Image = new List <Attachment>();

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

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

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

                break;

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

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

                LocationQualifier = new List <CodeableConcept>();

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

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

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

                break;

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

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

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "encounter":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Encounter = new List <Reference>();

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

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

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

                break;

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

                Event = new List <CodeableConcept>();

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

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

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

                break;

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

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

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

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

                Related = new List <Reference>();

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

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

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

                break;

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

            default:
                ((fhirCsR4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 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)
                {
                    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;
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "basedOn":
                BasedOn = new fhirCsR4.Models.Reference();
                BasedOn.DeserializeJson(ref reader, options);
                break;

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

                Basis = new List <Reference>();

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

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

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

                break;

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

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

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

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

                Identifier = new List <Identifier>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    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 "method":
                Method = new fhirCsR4.Models.CodeableConcept();
                Method.DeserializeJson(ref reader, options);
                break;

            case "mitigation":
                Mitigation = reader.GetString();
                break;

            case "_mitigation":
                _Mitigation = new fhirCsR4.Models.Element();
                _Mitigation.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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

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

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

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

                Prediction = new List <RiskAssessmentPrediction>();

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

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

                if (Prediction.Count == 0)
                {
                    Prediction = 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 "subject":
                Subject = new fhirCsR4.Models.Reference();
                Subject.DeserializeJson(ref reader, options);
                break;

            default:
                ((fhirCsR4.Models.DomainResource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "dataRequirement":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                DataRequirement = new List <DataRequirement>();

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

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

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

                break;

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

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

                EvaluationMessage = new List <Reference>();

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

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

                if (EvaluationMessage.Count == 0)
                {
                    EvaluationMessage = 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 "moduleUri":
                ModuleUri = reader.GetString();
                break;

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

            case "moduleCanonical":
                ModuleCanonical = reader.GetString();
                break;

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

            case "moduleCodeableConcept":
                ModuleCodeableConcept = new fhirCsR4.Models.CodeableConcept();
                ModuleCodeableConcept.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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

            case "performer":
                Performer = new fhirCsR4.Models.Reference();
                Performer.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)
                {
                    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 "requestIdentifier":
                RequestIdentifier = new fhirCsR4.Models.Identifier();
                RequestIdentifier.DeserializeJson(ref reader, options);
                break;

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

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

            case "_status":
                _Status = new fhirCsR4.Models.Element();
                _Status.DeserializeJson(ref reader, options);
                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;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "data":
                Data = System.Convert.FromBase64String(reader.GetString());
                break;

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

            case "sigFormat":
                SigFormat = reader.GetString();
                break;

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

            case "targetFormat":
                TargetFormat = reader.GetString();
                break;

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

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

                Type = new List <Coding>();

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

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

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

                break;

            case "when":
                When = reader.GetString();
                break;

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

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

            default:
                ((fhirCsR4.Models.Element) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "about":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                About = new List <Reference>();

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

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

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

                break;

            case "authoredOn":
                AuthoredOn = reader.GetString();
                break;

            case "_authoredOn":
                _AuthoredOn = new fhirCsR4.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)
                {
                    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":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Category = new List <CodeableConcept>();

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

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

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

                break;

            case "doNotPerform":
                DoNotPerform = reader.GetBoolean();
                break;

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

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

                Medium = new List <CodeableConcept>();

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

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

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

                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 "occurrenceDateTime":
                OccurrenceDateTime = reader.GetString();
                break;

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

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

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

                Payload = new List <CommunicationRequestPayload>();

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

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

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

                break;

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

            case "_priority":
                _Priority = new fhirCsR4.Models.Element();
                _Priority.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)
                {
                    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 "recipient":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Recipient = new List <Reference>();

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

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

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

                break;

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

                Replaces = new List <Reference>();

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

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

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

                break;

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

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

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

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

            case "statusReason":
                StatusReason = new fhirCsR4.Models.CodeableConcept();
                StatusReason.DeserializeJson(ref reader, options);
                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;
            }
        }