public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationStatement; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (InformationSource != null) { dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopy(); } if (DateAssertedElement != null) { dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationStatement.MedicationStatementStatus>)StatusElement.DeepCopy(); } if (WasNotTakenElement != null) { dest.WasNotTakenElement = (Hl7.Fhir.Model.FhirBoolean)WasNotTakenElement.DeepCopy(); } if (ReasonNotTaken != null) { dest.ReasonNotTaken = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotTaken.DeepCopy()); } if (ReasonForUse != null) { dest.ReasonForUse = (Hl7.Fhir.Model.Element)ReasonForUse.DeepCopy(); } if (Effective != null) { dest.Effective = (Hl7.Fhir.Model.Element)Effective.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (SupportingInformation != null) { dest.SupportingInformation = new List <Hl7.Fhir.Model.ResourceReference>(SupportingInformation.DeepCopy()); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.Element)Medication.DeepCopy(); } if (Dosage != null) { dest.Dosage = new List <Hl7.Fhir.Model.MedicationStatement.DosageComponent>(Dosage.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationStatement; 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 (BasedOn != null) { dest.BasedOn = new List <Hl7.Fhir.Model.ResourceReference>(BasedOn.DeepCopy()); } if (PartOf != null) { dest.PartOf = new List <Hl7.Fhir.Model.ResourceReference>(PartOf.DeepCopy()); } if (Context != null) { dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationStatement.MedicationStatementStatus>)StatusElement.DeepCopy(); } if (Category != null) { dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); } if (Effective != null) { dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); } if (DateAssertedElement != null) { dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopy(); } if (InformationSource != null) { dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (DerivedFrom != null) { dest.DerivedFrom = new List <Hl7.Fhir.Model.ResourceReference>(DerivedFrom.DeepCopy()); } if (TakenElement != null) { dest.TakenElement = (Code <Hl7.Fhir.Model.MedicationStatement.MedicationStatementTaken>)TakenElement.DeepCopy(); } if (ReasonNotTaken != null) { dest.ReasonNotTaken = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotTaken.DeepCopy()); } if (ReasonCode != null) { dest.ReasonCode = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonCode.DeepCopy()); } if (ReasonReference != null) { dest.ReasonReference = new List <Hl7.Fhir.Model.ResourceReference>(ReasonReference.DeepCopy()); } if (Note != null) { dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy()); } if (Dosage != null) { dest.Dosage = new List <Hl7.Fhir.Model.Dosage>(Dosage.DeepCopy()); } return(dest); }