public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as VaccinationProtocolComponent; if (dest != null) { base.CopyTo(dest); if (DoseSequenceElement != null) { dest.DoseSequenceElement = (Hl7.Fhir.Model.PositiveInt)DoseSequenceElement.DeepCopy(); } if (DescriptionElement != null) { dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); } if (Authority != null) { dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopy(); } if (SeriesElement != null) { dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); } if (SeriesDosesElement != null) { dest.SeriesDosesElement = (Hl7.Fhir.Model.PositiveInt)SeriesDosesElement.DeepCopy(); } if (TargetDisease != null) { dest.TargetDisease = new List <Hl7.Fhir.Model.CodeableConcept>(TargetDisease.DeepCopy()); } if (DoseStatus != null) { dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopy(); } if (DoseStatusReason != null) { dest.DoseStatusReason = (Hl7.Fhir.Model.CodeableConcept)DoseStatusReason.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (DoseSequenceElement != null) { result.AddRange(DoseSequenceElement.Validate()); } if (DescriptionElement != null) { result.AddRange(DescriptionElement.Validate()); } if (Authority != null) { result.AddRange(Authority.Validate()); } if (SeriesElement != null) { result.AddRange(SeriesElement.Validate()); } if (SeriesDosesElement != null) { result.AddRange(SeriesDosesElement.Validate()); } if (DoseTarget != null) { result.AddRange(DoseTarget.Validate()); } if (DoseStatus != null) { result.AddRange(DoseStatus.Validate()); } if (DoseStatusReason != null) { result.AddRange(DoseStatusReason.Validate()); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as ImmunizationEvaluation; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (DateElement != null) { dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); } if (Authority != null) { dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopy(); } if (TargetDisease != null) { dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopy(); } if (ImmunizationEvent != null) { dest.ImmunizationEvent = (Hl7.Fhir.Model.ResourceReference)ImmunizationEvent.DeepCopy(); } if (DoseStatus != null) { dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopy(); } if (DoseStatusReason != null) { dest.DoseStatusReason = new List <Hl7.Fhir.Model.CodeableConcept>(DoseStatusReason.DeepCopy()); } if (DescriptionElement != null) { dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); } if (SeriesElement != null) { dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); } if (DoseNumberElement != null) { dest.DoseNumberElement = (Hl7.Fhir.Model.FhirString)DoseNumberElement.DeepCopy(); } if (SeriesDosesElement != null) { dest.SeriesDosesElement = (Hl7.Fhir.Model.FhirString)SeriesDosesElement.DeepCopy(); } return(dest); }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } if (!string.IsNullOrEmpty(ResourceType)) { writer.WriteString("resourceType", (string)ResourceType !); } ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false); if ((Identifier != null) && (Identifier.Count != 0)) { writer.WritePropertyName("identifier"); writer.WriteStartArray(); foreach (Identifier valIdentifier in Identifier) { valIdentifier.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Status)) { writer.WriteString("status", (string)Status !); } if (_Status != null) { writer.WritePropertyName("_status"); _Status.SerializeJson(writer, options); } if (Patient != null) { writer.WritePropertyName("patient"); Patient.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Date)) { writer.WriteString("date", (string)Date !); } if (_Date != null) { writer.WritePropertyName("_date"); _Date.SerializeJson(writer, options); } if (Authority != null) { writer.WritePropertyName("authority"); Authority.SerializeJson(writer, options); } if (TargetDisease != null) { writer.WritePropertyName("targetDisease"); TargetDisease.SerializeJson(writer, options); } if (ImmunizationEvent != null) { writer.WritePropertyName("immunizationEvent"); ImmunizationEvent.SerializeJson(writer, options); } if (DoseStatus != null) { writer.WritePropertyName("doseStatus"); DoseStatus.SerializeJson(writer, options); } if ((DoseStatusReason != null) && (DoseStatusReason.Count != 0)) { writer.WritePropertyName("doseStatusReason"); writer.WriteStartArray(); foreach (CodeableConcept valDoseStatusReason in DoseStatusReason) { valDoseStatusReason.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Description)) { writer.WriteString("description", (string)Description !); } if (_Description != null) { writer.WritePropertyName("_description"); _Description.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Series)) { writer.WriteString("series", (string)Series !); } if (_Series != null) { writer.WritePropertyName("_series"); _Series.SerializeJson(writer, options); } if (DoseNumberPositiveInt != null) { writer.WriteNumber("doseNumberPositiveInt", (uint)DoseNumberPositiveInt !); } if (!string.IsNullOrEmpty(DoseNumberString)) { writer.WriteString("doseNumberString", (string)DoseNumberString !); } if (_DoseNumberString != null) { writer.WritePropertyName("_doseNumberString"); _DoseNumberString.SerializeJson(writer, options); } if (SeriesDosesPositiveInt != null) { writer.WriteNumber("seriesDosesPositiveInt", (uint)SeriesDosesPositiveInt !); } if (!string.IsNullOrEmpty(SeriesDosesString)) { writer.WriteString("seriesDosesString", (string)SeriesDosesString !); } if (_SeriesDosesString != null) { writer.WritePropertyName("_seriesDosesString"); _SeriesDosesString.SerializeJson(writer, options); } if (includeStartObject) { writer.WriteEndObject(); } }