public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Observation; if (dest != null) { base.CopyTo(dest); if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (Value != null) { dest.Value = (Hl7.Fhir.Model.Element)Value.DeepCopy(); } if (DataAbsentReason != null) { dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); } if (Interpretation != null) { dest.Interpretation = (Hl7.Fhir.Model.CodeableConcept)Interpretation.DeepCopy(); } if (CommentsElement != null) { dest.CommentsElement = (Hl7.Fhir.Model.FhirString)CommentsElement.DeepCopy(); } if (Applies != null) { dest.Applies = (Hl7.Fhir.Model.Element)Applies.DeepCopy(); } if (IssuedElement != null) { dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Observation.ObservationStatus>)StatusElement.DeepCopy(); } if (ReliabilityElement != null) { dest.ReliabilityElement = (Code <Hl7.Fhir.Model.Observation.ObservationReliability>)ReliabilityElement.DeepCopy(); } if (BodySite != null) { dest.BodySite = (Hl7.Fhir.Model.Element)BodySite.DeepCopy(); } if (Method != null) { dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Specimen != null) { dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); } if (Performer != null) { dest.Performer = new List <Hl7.Fhir.Model.ResourceReference>(Performer.DeepCopy()); } if (Device != null) { dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (ReferenceRange != null) { dest.ReferenceRange = new List <Hl7.Fhir.Model.Observation.ObservationReferenceRangeComponent>(ReferenceRange.DeepCopy()); } if (Related != null) { dest.Related = new List <Hl7.Fhir.Model.Observation.ObservationRelatedComponent>(Related.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }