예제 #1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "author":
                Author = new Fhir.R4.Models.Reference();
                Author.DeserializeJson(ref reader, options);
                break;

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

            case "_authored":
                _Authored = new Fhir.R4.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)
                {
                    Fhir.R4.Models.Reference objBasedOn = new Fhir.R4.Models.Reference();
                    objBasedOn.DeserializeJson(ref reader, options);
                    BasedOn.Add(objBasedOn);

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

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

                break;

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

            case "identifier":
                Identifier = new Fhir.R4.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)
                {
                    Fhir.R4.Models.QuestionnaireResponseItem objItem = new Fhir.R4.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)
                {
                    Fhir.R4.Models.Reference objPartOf = new Fhir.R4.Models.Reference();
                    objPartOf.DeserializeJson(ref reader, options);
                    PartOf.Add(objPartOf);

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

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

                break;

            case "questionnaire":
                Questionnaire = reader.GetString();
                break;

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

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

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

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

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

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

                BasedOn = new List <Reference>();

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

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

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

                break;

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

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

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

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

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

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

                break;

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

                Dosage = new List <Dosage>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.Dosage objDosage = new Fhir.R4.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 Fhir.R4.Models.Element();
                _EffectiveDateTime.DeserializeJson(ref reader, options);
                break;

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

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

                Identifier = new List <Identifier>();

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

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

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

                break;

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

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

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

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

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

                break;

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

                PartOf = new List <Reference>();

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

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

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

                break;

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

                ReasonCode = new List <CodeableConcept>();

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

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

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

                break;

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

                ReasonReference = new List <Reference>();

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

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

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

                break;

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

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

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

                Item = new List <QuestionnaireResponseItem>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    Fhir.R4.Models.QuestionnaireResponseItem objItem = new Fhir.R4.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 Fhir.R4.Models.Element();
                _ValueDecimal.DeserializeJson(ref reader, options);
                break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            default:
                ((Fhir.R4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
예제 #4
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "abnormalCodedValueSet":
                AbnormalCodedValueSet = new Fhir.R4.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)
                {
                    Fhir.R4.Models.CodeableConcept objCategory = new Fhir.R4.Models.CodeableConcept();
                    objCategory.DeserializeJson(ref reader, options);
                    Category.Add(objCategory);

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

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

                break;

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

            case "criticalCodedValueSet":
                CriticalCodedValueSet = new Fhir.R4.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)
                {
                    Fhir.R4.Models.Identifier objIdentifier = new Fhir.R4.Models.Identifier();
                    objIdentifier.DeserializeJson(ref reader, options);
                    Identifier.Add(objIdentifier);

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

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

                break;

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

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

            case "normalCodedValueSet":
                NormalCodedValueSet = new Fhir.R4.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)
                {
                    Fhir.R4.Models.Element obj_PermittedDataType = new Fhir.R4.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 Fhir.R4.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)
                {
                    Fhir.R4.Models.ObservationDefinitionQualifiedInterval objQualifiedInterval = new Fhir.R4.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 Fhir.R4.Models.ObservationDefinitionQuantitativeDetails();
                QuantitativeDetails.DeserializeJson(ref reader, options);
                break;

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

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