Ejemplo n.º 1
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;
            }
        }