/// <summary> /// Deserialize JSON into a FHIR MedicinalProductUndesirableEffect /// </summary> public static void DeserializeJsonProperty(this MedicinalProductUndesirableEffect current, ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName) { switch (propertyName) { case "subject": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductUndesirableEffect error reading 'subject' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.Subject = new List <ResourceReference>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.ResourceReference v_Subject = new Hl7.Fhir.Model.ResourceReference(); v_Subject.DeserializeJson(ref reader, options); current.Subject.Add(v_Subject); if (!reader.Read()) { throw new JsonException($"MedicinalProductUndesirableEffect error reading 'subject' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.Subject.Count == 0) { current.Subject = null; } break; case "symptomConditionEffect": current.SymptomConditionEffect = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.SymptomConditionEffect).DeserializeJson(ref reader, options); break; case "classification": current.Classification = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.Classification).DeserializeJson(ref reader, options); break; case "frequencyOfOccurrence": current.FrequencyOfOccurrence = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.FrequencyOfOccurrence).DeserializeJson(ref reader, options); break; case "population": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductUndesirableEffect error reading 'population' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.Population = new List <Population>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.Population v_Population = new Hl7.Fhir.Model.Population(); v_Population.DeserializeJson(ref reader, options); current.Population.Add(v_Population); if (!reader.Read()) { throw new JsonException($"MedicinalProductUndesirableEffect error reading 'population' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.Population.Count == 0) { current.Population = null; } break; // Complex: MedicinalProductUndesirableEffect, Export: MedicinalProductUndesirableEffect, Base: DomainResource default: ((Hl7.Fhir.Model.DomainResource)current).DeserializeJsonProperty(ref reader, options, propertyName); break; } }
/// <summary> /// Deserialize JSON into a FHIR MedicinalProductContraindication /// </summary> public static void DeserializeJsonProperty(this MedicinalProductContraindication current, ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName) { switch (propertyName) { case "subject": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductContraindication error reading 'subject' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.Subject = new List <ResourceReference>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.ResourceReference v_Subject = new Hl7.Fhir.Model.ResourceReference(); v_Subject.DeserializeJson(ref reader, options); current.Subject.Add(v_Subject); if (!reader.Read()) { throw new JsonException($"MedicinalProductContraindication error reading 'subject' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.Subject.Count == 0) { current.Subject = null; } break; case "disease": current.Disease = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.Disease).DeserializeJson(ref reader, options); break; case "diseaseStatus": current.DiseaseStatus = new Hl7.Fhir.Model.CodeableConcept(); ((Hl7.Fhir.Model.CodeableConcept)current.DiseaseStatus).DeserializeJson(ref reader, options); break; case "comorbidity": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductContraindication error reading 'comorbidity' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.Comorbidity = new List <CodeableConcept>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.CodeableConcept v_Comorbidity = new Hl7.Fhir.Model.CodeableConcept(); v_Comorbidity.DeserializeJson(ref reader, options); current.Comorbidity.Add(v_Comorbidity); if (!reader.Read()) { throw new JsonException($"MedicinalProductContraindication error reading 'comorbidity' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.Comorbidity.Count == 0) { current.Comorbidity = null; } break; case "therapeuticIndication": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductContraindication error reading 'therapeuticIndication' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.TherapeuticIndication = new List <ResourceReference>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.ResourceReference v_TherapeuticIndication = new Hl7.Fhir.Model.ResourceReference(); v_TherapeuticIndication.DeserializeJson(ref reader, options); current.TherapeuticIndication.Add(v_TherapeuticIndication); if (!reader.Read()) { throw new JsonException($"MedicinalProductContraindication error reading 'therapeuticIndication' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.TherapeuticIndication.Count == 0) { current.TherapeuticIndication = null; } break; case "otherTherapy": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductContraindication error reading 'otherTherapy' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.OtherTherapy = new List <MedicinalProductContraindication.OtherTherapyComponent>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.MedicinalProductContraindication.OtherTherapyComponent v_OtherTherapy = new Hl7.Fhir.Model.MedicinalProductContraindication.OtherTherapyComponent(); v_OtherTherapy.DeserializeJson(ref reader, options); current.OtherTherapy.Add(v_OtherTherapy); if (!reader.Read()) { throw new JsonException($"MedicinalProductContraindication error reading 'otherTherapy' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.OtherTherapy.Count == 0) { current.OtherTherapy = null; } break; case "population": if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read())) { throw new JsonException($"MedicinalProductContraindication error reading 'population' expected StartArray, found {reader.TokenType}! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } current.Population = new List <Population>(); while (reader.TokenType != JsonTokenType.EndArray) { Hl7.Fhir.Model.Population v_Population = new Hl7.Fhir.Model.Population(); v_Population.DeserializeJson(ref reader, options); current.Population.Add(v_Population); if (!reader.Read()) { throw new JsonException($"MedicinalProductContraindication error reading 'population' array, read failed! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}"); } if (reader.TokenType == JsonTokenType.EndObject) { reader.Read(); } } if (current.Population.Count == 0) { current.Population = null; } break; // Complex: MedicinalProductContraindication, Export: MedicinalProductContraindication, Base: DomainResource default: ((Hl7.Fhir.Model.DomainResource)current).DeserializeJsonProperty(ref reader, options, propertyName); break; } }